Skip to content

Commit

Permalink
prevent navigation on url input suggestion selection via enter key (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu authored May 16, 2022
1 parent 3a2a555 commit bb9ec8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/url-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ class URLInput extends Component {

// Submitting while loading should trigger onSubmit.
case ENTER: {
event.preventDefault();
if ( this.props.onSubmit ) {
this.props.onSubmit( null, event );
}
Expand Down Expand Up @@ -350,6 +351,7 @@ class URLInput extends Component {
break;
}
case ENTER: {
event.preventDefault();
if ( this.state.selectedSuggestion !== null ) {
this.selectLink( suggestion );

Expand Down

0 comments on commit bb9ec8b

Please sign in to comment.