Skip to content

Commit 81fafc0

Browse files
committed
Bugfix: Unable to activate search form on phone
This commit fixes the bug, when user was not able to activate search form on mobile device after two sequential clicks on search icon (label). Bug description: 1. First click (Field should show up): `focus` event is triggered and form is shown. 2. Second click (Field should show off): `blur` and `focus` events are triggered 2.1. Blur event set the timeout to hide the field. 2.2. Focus event adds the `active` class to the field. 2.3. Timeout function is called and field becomes hidden. 2.4. Field is still has `focus` state, because user clicked on label again. 3. **Third click (Field should show up): `blur` and `focus` events are triggered again, and field will not show up.** Proposed patch adds additional logic into 2.1: **Blur event will set the timeout to hide the field if the field already has `active` class name**
1 parent 8fd3e8a commit 81fafc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ define([
5858
this.element.attr('autocomplete', this.options.autocomplete);
5959

6060
this.element.on('blur', $.proxy(function () {
61+
if (!this.searchLabel.hasClass('active')) {
62+
return;
63+
}
6164

6265
setTimeout($.proxy(function () {
6366
if (this.autoComplete.is(':hidden')) {

0 commit comments

Comments
 (0)