FIX: disable input zoom on search in iOS

FIX: disable input zoom on search in iOS

diff --git a/app/assets/javascripts/discourse/components/search-text-field.js.es6 b/app/assets/javascripts/discourse/components/search-text-field.js.es6
index bddc31e..81d6642 100644
--- a/app/assets/javascripts/discourse/components/search-text-field.js.es6
+++ b/app/assets/javascripts/discourse/components/search-text-field.js.es6
@@ -20,6 +20,6 @@ export default TextField.extend({
     // iOS is crazy, without this we will not be
     // at the top of the page
     $(window).scrollTop(0);
-    $searchInput.focus();
+    $searchInput.trigger("touchstart").focus();
   }
 });
diff --git a/app/assets/javascripts/discourse/widgets/header.js.es6 b/app/assets/javascripts/discourse/widgets/header.js.es6
index 271600c..909e4ac 100644
--- a/app/assets/javascripts/discourse/widgets/header.js.es6
+++ b/app/assets/javascripts/discourse/widgets/header.js.es6
@@ -410,7 +410,9 @@ export default createWidget("header", {
 
       if (currentPath === "full-page-search") {
         scrollTop();
-        $(".full-page-search").focus();
+        $(".full-page-search")
+          .trigger("touchstart")
+          .focus();
         return false;
       } else {
         return DiscourseURL.routeTo("/search" + params);

GitHub sha: a4529330

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: