Skip to content

Commit

Permalink
Stop propagating backspace and enter keys from the URL input
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 6, 2018
1 parent 0ab1dca commit 9d51a91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blocks/rich-text/format-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './style.scss';
import UrlInput from '../../url-input';
import { filterURLForDisplay } from '../../../editor/utils/url';

const { ESCAPE, LEFT, RIGHT, UP, DOWN } = keycodes;
const { ESCAPE, LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } = keycodes;

const FORMATTING_CONTROLS = [
{
Expand Down Expand Up @@ -69,7 +69,7 @@ class FormatToolbar extends Component {
this.dropLink();
}
}
if ( [ LEFT, DOWN, RIGHT, UP ].indexOf( event.keyCode ) > -1 ) {
if ( [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( event.keyCode ) > -1 ) {
stopKeyPropagation( event );
}
}
Expand Down

0 comments on commit 9d51a91

Please sign in to comment.