From 8255553e9743d0f21ee05b704b4ea2910bf983cc Mon Sep 17 00:00:00 2001 From: Leo Koppelkamm Date: Sun, 12 May 2013 18:49:07 +0200 Subject: [PATCH] Don't focus the text area on touch devices to avoid flashing the keyboard Currently the keyboard slide out & hides again quickly. --- app/assets/javascripts/index/notes.js.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) { -- 2.39.5