Skip to content

Commit 0f53f67

Browse files
committed
After closing the autocomplete dropdown by clicking away from it, return focus to the search input element.
Otherwise the searchbox that was opened will not close when clicking away from it. You need to return the focus to it by clicking it again, and only then you can close it by clicking away from it. Steps to reproduce: Search something that gets some search result so that the autocomplete gets populated. Start searching for it again so that the dropdown opens. Click away (dropdown should close). Click away again (the search bar will not close, against user expectation).
1 parent 1856c28 commit 0f53f67

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ define([
8686
setTimeout($.proxy(function () {
8787
if (this.autoComplete.is(':hidden')) {
8888
this.setActiveState(false);
89+
} else {
90+
this.element.trigger('focus');
8991
}
9092
this.autoComplete.hide();
9193
this._updateAriaHasPopup(false);

0 commit comments

Comments
 (0)