From: Anton Khorev Date: Sun, 6 Apr 2025 11:37:19 +0000 (+0300) Subject: Replace deprecated jQuery .focus() with .trigger("focus") X-Git-Tag: live~70^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2919473f5b0012b9b6557be821c01b60adee0903?ds=sidebyside;hp=-c Replace deprecated jQuery .focus() with .trigger("focus") --- 2919473f5b0012b9b6557be821c01b60adee0903 diff --git a/app/assets/javascripts/index/new_note.js b/app/assets/javascripts/index/new_note.js index 4f4ea52a8..0090570a9 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"); }); } @@ -90,7 +90,7 @@ OSM.NewNote = function (map) { 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,7 @@ OSM.NewNote = function (map) { content.find("textarea") .on("input", updateControls) - .focus(); + .trigger("focus"); content.find("input[type=submit]").on("click", function (e) { const location = newNoteMarker.getLatLng().wrap();