-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable panning when mouse is over react-leaflet-control #2
Comments
If I understand correctly. The control pane is not seeing the scroll event, but the map catches it, and scrolls. I will need to create an example folder to test this. Unfortunately I am traveling today and cannot work on this. |
Yes, thats exactly what is happening. I have seen suggestions on github leaflet to register an event listener when mouse is entering custom control and to to call map.disablePan() within that event listener. That sounds very hacky to me and did not work reliably for me. What wonders me though is that only few people seem to complain about that issue. I looked into the zoom control code of react-leaflet which seems to block the events somehow but I could not find the reason for that. Thanks for your help in advance !! |
I found how popup's catch the scroll event. I think this is how you will want to handle scroll events.
|
I tried the code above, but got an Error. The problem is: React does not guarantee ref callbacks to be called after Here is my code that eliminated the error for me (plus, no need to bind
|
Thanks for this great extension ! I'm trying to scroll the content within the react-leaflet-control on mobile devices but instead the events seems to be passed to and consumed by the map. Is there a way to block passing those scroll and click events to the map ?
I crawled already through the whole react-leaflet github issues and stackoverflow but couldn't find an example that would work for me.
Help is very much appreciated
The text was updated successfully, but these errors were encountered: