Skip to content

Commit c806b16

Browse files
committed
Hit Enter to find next and Shift+Enter to find previous - Fix after review
1 parent e93b51e commit c806b16

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/ckeditor5-find-and-replace/src/ui/findandreplaceformview.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -735,14 +735,17 @@ export default class FindAndReplaceFormView extends View {
735735
this._keystrokes.set( 'shift+enter', event => {
736736
const target = event.target;
737737

738-
if ( target === this._findInputView.fieldView.element ) {
739-
if ( this._areCommandsEnabled.findPrevious ) {
740-
this._findPrevButtonView.fire( 'execute' );
741-
} else {
742-
this._findButtonView.fire( 'execute' );
743-
}
744-
stopPropagationAndPreventDefault( event );
738+
if ( target !== this._findInputView.fieldView.element ) {
739+
return;
745740
}
741+
742+
if ( this._areCommandsEnabled.findPrevious ) {
743+
this._findPrevButtonView.fire( 'execute' );
744+
} else {
745+
this._findButtonView.fire( 'execute' );
746+
}
747+
748+
stopPropagationAndPreventDefault( event );
746749
} );
747750

748751
// Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's

0 commit comments

Comments
 (0)