diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml
new file mode 100644
index 0000000000000..57d39e35d539e
--- /dev/null
+++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsDisabledActionGroup.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+ Verify search button has disabled attribute
+
+
+
+
+
+ $grabSearchButtonDisabledAttribute
+ true
+
+
+
diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml
new file mode 100644
index 0000000000000..2e1f8d4b68d36
--- /dev/null
+++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AssertStorefrontVerifySearchButtonIsEnabledActionGroup.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ Verify search button does not disabled attribute
+
+
+
+
+
+ $grabSearchButtonAttribute
+
+
+
diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml
new file mode 100644
index 0000000000000..f90297df02c1f
--- /dev/null
+++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/StoreFrontFillSearchActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml
new file mode 100644
index 0000000000000..742807d2c24e2
--- /dev/null
+++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonDisabledTillMinimumSearchLengthHitTest.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml
new file mode 100644
index 0000000000000..172fae919623c
--- /dev/null
+++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchButtonEnabledAfterMinimumSearchLengthHitTest.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js
index b4493c5f38089..9b4c814f73d73 100644
--- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js
+++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js
@@ -232,8 +232,10 @@ define([
break;
case $.ui.keyCode.ENTER:
- this.searchForm.trigger('submit');
- e.preventDefault();
+ if (this.element.val().length >= parseInt(this.options.minSearchLength, 10)) {
+ this.searchForm.trigger('submit');
+ e.preventDefault();
+ }
break;
case $.ui.keyCode.DOWN:
@@ -294,9 +296,10 @@ define([
dropdown = $('
'),
value = this.element.val();
- this.submitBtn.disabled = isEmpty(value);
+ this.submitBtn.disabled = true;
if (value.length >= parseInt(this.options.minSearchLength, 10)) {
+ this.submitBtn.disabled = false;
$.getJSON(this.options.url, {
q: value
}, $.proxy(function (data) {