]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
Remove click search (reverse) propagation on search page
authorEric Grosso <19222193+ericgrosso@users.noreply.github.com>
Thu, 13 Jun 2024 15:57:11 +0000 (16:57 +0100)
committermtmail <mtmail@gmx.net>
Thu, 13 Jun 2024 23:50:12 +0000 (01:50 +0200)
src/components/SearchSectionReverse.svelte

index 70174b697ed9f1ba552a582d1079ec518806cb07..1808b30da73fd8ea88cb340b028ea92fc3118efd 100644 (file)
@@ -1,4 +1,5 @@
 <script>
+  import { onDestroy } from 'svelte';
   import UrlSubmitForm from '../components/UrlSubmitForm.svelte';
 
   import { zoomLevels } from '../lib/helpers.js';
@@ -19,7 +20,7 @@
     refresh_page('reverse', params);
   }
 
-  map_store.subscribe(map => {
+  const unsubscribe = map_store.subscribe(map => {
     if (map) {
       map.on('click', (e) => {
         let coords = e.latlng.wrap();
@@ -40,6 +41,8 @@
   function set_api_param(e) {
     document.querySelector('input[name=' + e.target.dataset.apiParam + ']').value = e.target.value;
   }
+
+  onDestroy(unsubscribe);
 </script>
 
 <UrlSubmitForm page="reverse">