From: Tom Hughes Date: Sun, 6 Apr 2025 14:11:20 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5900' X-Git-Tag: live~76 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a408c609d98a28b01c8e29cda82526c67f1651ca?hp=08a1839b5fca5981727f2f57bebe99c3ae8583cb Merge remote-tracking branch 'upstream/pull/5900' --- diff --git a/app/assets/javascripts/index/new_note.js b/app/assets/javascripts/index/new_note.js index 1b409846f..ff4a44126 100644 --- a/app/assets/javascripts/index/new_note.js +++ b/app/assets/javascripts/index/new_note.js @@ -77,7 +77,7 @@ OSM.NewNote = function (map) { addHalo(newNoteMarker.getLatLng()); newNoteMarker.on("dragend", function () { - content.find("textarea").focus(); + content.find("textarea").trigger("focus"); }); } @@ -87,10 +87,10 @@ OSM.NewNote = function (map) { newNoteMarker = null; } - function moveNewNotMarkerToClick(e) { + function moveNewNoteMarkerToClick(e) { if (newNoteMarker) newNoteMarker.setLatLng(e.latlng); if (halo) halo.setLatLng(e.latlng); - content.find("textarea").focus(); + content.find("textarea").trigger("focus"); } function updateControls() { @@ -130,7 +130,9 @@ OSM.NewNote = function (map) { content.find("textarea") .on("input", updateControls) - .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(); @@ -152,7 +154,7 @@ OSM.NewNote = function (map) { }); }); - map.on("click", moveNewNotMarkerToClick); + map.on("click", moveNewNoteMarkerToClick); addNoteButton.on("disabled enabled", updateControls); updateControls(); @@ -160,7 +162,7 @@ OSM.NewNote = function (map) { }; page.unload = function () { - map.off("click", moveNewNotMarkerToClick); + map.off("click", moveNewNoteMarkerToClick); addNoteButton.off("disabled enabled", updateControls); removeNewNoteMarker(); addNoteButton.removeClass("active");