-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
.off(): unexpected behavior #6596
Comments
Current behavior is highly undesirable in my setup, because:
So I'd prefer if plugin'd not affect main script base functionality. |
I disagree. The point of
I agree with this. This should be a simple case of changing the wording at... Line 68 in 3f5979b
...and adding something like "This includes implicitly attached events". Not sure what the best wording would be. |
I can agree with this. |
But there is no way to tell apart "implicit" versus "explicit" event listeners in the code. |
Well, I suppose we can improve the code. Like, add owner to every listener as a property. |
.off()
method unexpectedly removes listeners of the parent objectSteps to reproduce
Steps to reproduce the behavior:
layer
and add it Layers controlmap
layer
(https://leafletjs.com/reference-1.4.0.html#layergroup-off)Expected behavior
Only listeners directly attached to
layer
should be removedCurrent behavior
map
listeners get removed too, unexpectedlyEnvironment
Additional context
It can appear that this behavior is by current leaflet design.
In this case we should at least document it explicitly and in detail!
Minimal example reproducing the issue
https://jsfiddle.net/johnd0e/jy84gsL2/16/
The text was updated successfully, but these errors were encountered: