Skip to content

Commit

Permalink
Fix: make meta+A behaviour of selecting all blocks work on safari and…
Browse files Browse the repository at this point in the history
… firefox. (#8180)

On safari and firefox isEntirelySelected( target ) called right after meta+A event is fired when meta key is not released in the middle returns false but the content gets selected anyway.
If the target is editable it is safe to assume TinyMCE will make sure all content gets selected so in this cases we set the value to true without calling isEntirelySelected.
  • Loading branch information
jorgefilipecosta authored Nov 1, 2018
1 parent 1acf062 commit b3e0e89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/editor/src/components/writing-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ class WritingFlow extends Component {
event.preventDefault();
}

// Set in case the meta key doesn't get released.
this.isEntirelySelected = isEntirelySelected( target );
// After pressing primary + A we can assume isEntirelySelected is true.
// Calling right away isEntirelySelected after primary + A may still return false on some browsers.
this.isEntirelySelected = true;
}

return;
Expand Down

0 comments on commit b3e0e89

Please sign in to comment.