]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid virtual keyboard when visiting new note page
authorAnton Khorev <tony29@yandex.ru>
Sun, 6 Apr 2025 11:44:54 +0000 (14:44 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 6 Apr 2025 12:12:16 +0000 (15:12 +0300)
app/assets/javascripts/index/new_note.js

index 0090570a934c2a2131a18dbaa7b26363ba56b671..ff4a441263e0b7cc96ba77eef9bc65140da79c97 100644 (file)
@@ -130,7 +130,9 @@ OSM.NewNote = function (map) {
 
     content.find("textarea")
       .on("input", updateControls)
 
     content.find("textarea")
       .on("input", updateControls)
-      .trigger("focus");
+      .attr("readonly", "readonly") // avoid virtual keyboard popping up on focus
+      .trigger("focus")
+      .removeAttr("readonly");
 
     content.find("input[type=submit]").on("click", function (e) {
       const location = newNoteMarker.getLatLng().wrap();
 
     content.find("input[type=submit]").on("click", function (e) {
       const location = newNoteMarker.getLatLng().wrap();