]> git.openstreetmap.org Git - rails.git/commitdiff
Replace deprecated jQuery .focus() with .trigger("focus")
authorAnton Khorev <tony29@yandex.ru>
Sun, 6 Apr 2025 11:37:19 +0000 (14:37 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 6 Apr 2025 11:37:19 +0000 (14:37 +0300)
app/assets/javascripts/index/new_note.js

index 4f4ea52a8b01f29b0c100a8b5740568e1f8abf19..0090570a934c2a2131a18dbaa7b26363ba56b671 100644 (file)
@@ -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();