Skip to content

Commit 90f884f

Browse files
krzkszmageprince
authored andcommitted
Act better on existing input focus instead of removing it
The focus of the input field is maintained, proper classes are added and autocomplete fires once the component is initialized.
1 parent b42f13b commit 90f884f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ define([
8989
}, this), 250);
9090
}, this));
9191

92-
this.element.trigger('blur');
92+
if (this.element.get(0) === document.activeElement) {
93+
this.setActiveState(true);
94+
}
9395

9496
this.element.on('focus', this.setActiveState.bind(this, true));
9597
this.element.on('keydown', this._onKeyDown);

0 commit comments

Comments
 (0)