leaflet-search icon indicating copy to clipboard operation
leaflet-search copied to clipboard

scroll problem on search results with firefox

Open pouemes opened this issue 3 years ago • 2 comments
trafficstars

take this example with leaflet-search 3.02 https://opengeo.tech/maps/leaflet-search/examples/geojson-layer.html replace https://unpkg.com/[email protected]/dist/leaflet.css and https://unpkg.com/[email protected]/dist/leaflet.js by leaflet version 1.7.1 or 1.8.0

search for m then try to scroll on the result, if it work with chrome edge and opera, it doen't work with firefox pehaps someone could understand why?

pouemes avatar Jul 01 '22 08:07 pouemes

This is a issue with the plugin / Firefox, because it uses the old mousewheel event listener instead of wheel to prevent zooming on the map. Firefox doesn't fire mousewheel anymore: https://plnkr.co/edit/sbrPjG2j2GRJ3Av0

You use this simple workaround:

 your code ....
// adding the controller to the map
map.addControl( searchControl ); // or searchControl.addTo(map);

// disable zoom scrolling in the search container
L.DomEvent.disableScrollPropagation(searchControl.getContainer());

Falke-Design avatar Jul 05 '22 21:07 Falke-Design

yes work now: in leaflet-search.src.js line 318 replace .on(tool, 'mousewheel', function(e) { by .on(tool, 'wheel', function(e) {

pouemes avatar Jul 07 '22 03:07 pouemes