Skip to content

Commit

Permalink
Fixes writer field empty state #3365
Browse files Browse the repository at this point in the history
  • Loading branch information
afbora committed Jun 10, 2021
1 parent ea5a096 commit ed44cf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion panel/src/components/Writer/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ export default class Editor extends Emitter {

isEmpty() {
if (this.state) {
return this.state.doc.textContent.length === 0;
// when a new list item or heading is created, textContent length returns 0
// checking active nodes to prevent this
// empty input means just the paragraph node and its length 0
return this.state.doc.textContent.length === 0 && this.activeNodes === ["paragraph"];
}
}

Expand Down

0 comments on commit ed44cf6

Please # to comment.