]> git.openstreetmap.org Git - rails.git/commitdiff
Don't focus the text area on touch devices to avoid flashing the keyboard
authorLeo Koppelkamm <diebuche@gmail.com>
Sun, 12 May 2013 16:49:07 +0000 (18:49 +0200)
committerTom Hughes <tom@compton.nu>
Sun, 12 May 2013 18:26:05 +0000 (19:26 +0100)
Currently the keyboard slide out & hides again quickly.

app/assets/javascripts/index/notes.js.erb

index f414f0e34621d1ff6e2d6b8ce8c016ab487b4e4b..b7331005bc6a99d0a4f740fd5bca1a80cb4d78c7 100644 (file)
@@ -46,9 +46,12 @@ $(document).ready(function () {
     }
   });
 
-  map.on("popupopen", function (e) {
-    $(e.popup._container).find(".comment").focus();
-  });
+  // Don't focus the text area on touch devices to avoid flashing the keyboard
+  if (!('ontouchstart' in document.documentElement)) {
+    map.on("popupopen", function (e) {
+      $(e.popup._container).find(".comment").focus();
+    });
+  }
 
   map.on("popupclose", function (e) {
     if (newNote && e.popup == newNote._popup) {