Skip to content

Commit

Permalink
Rich Text: Ensure format toolbar manages its own dismissal
Browse files Browse the repository at this point in the history
Previously only closed on esc when editing link, not adding new link

TODO: Consolidate editing state
  • Loading branch information
aduth committed Mar 9, 2018
1 parent bf49ca9 commit 5886309
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/rich-text/format-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FormatToolbar extends Component {

onKeyDown( event ) {
if ( event.keyCode === ESCAPE ) {
if ( this.state.isEditingLink ) {
if ( this.state.isEditingLink || this.state.isAddingLink ) {
event.stopPropagation();
this.dropLink();
}
Expand Down

0 comments on commit 5886309

Please sign in to comment.