From: Leo Koppelkamm Date: Sun, 12 May 2013 16:49:07 +0000 (+0200) Subject: Don't focus the text area on touch devices to avoid flashing the keyboard X-Git-Tag: live~5015 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8255553e9743d0f21ee05b704b4ea2910bf983cc Don't focus the text area on touch devices to avoid flashing the keyboard Currently the keyboard slide out & hides again quickly. --- diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index f414f0e34..b7331005b 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -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) {