Conversation
Hmm, but why? I think I'd prefer to keep not bubbling up from markers the default. |
The map is an event target, so it's considered while traversing the DOM, and given that it listens for
Are we sure it's a problem (out of retrocompat) ? It's closer to DOM behaviour, no? |
|
@yohanboniface problem not in |
|
@ktoto (take this with caution, as it's not fully decided): with the current code when you listen to a click event and you don't want the map to also receive it, you are responsible of stopping it. |
|
@yohanboniface but before #3307 all be fine. I just want to understand why logic with map is changed? |
Just like in normal DOM, when an event is fired by an element, all its ancestors get it, unless |
|
I'd rather not follow DOM conventions and do an exception here, since I can't think of a use case where you'd want to trigger both map and marker on marker click, but people will have a very hard time adjusting to this breaking change. |
You mean exception for marker or for |
|
Exception for marker specifically, as opposed to vector layers and image overlays (which can be perceived as "click through" in some interfaces). |
|
OK, I'll do that asap :) |
|
@mourner only for |
|
@yohanboniface let's follow the 0.7.3 behavior here. |
src/core/Events.js
Outdated
0cd3868 to
4f10f2d
Compare
src/map/Map.js
Outdated
There was a problem hiding this comment.
Unfortunately IE only supports array indexOf starting from 9. We'll probably have to iterate over the array in a loop.
There was a problem hiding this comment.
Gasp :/
Should I add a polyfill L.Util.inArray for that? To make the code shorter here and more readable.
There was a problem hiding this comment.
Yeah, maybe something like L.Util.indexOf.
There was a problem hiding this comment.
L.Util.indexOf seems meaning it also will work on strings, is that what we want?
There was a problem hiding this comment.
It's fine to keep only for arrays since string indexOf doesn't need an util method. It's an internal utility after all, we don't have to make it generic.
|
Yeah, Chrome vs FF :/ |
|
OK, let's rebase now. |
Humm, not sure which moment :p Seems I've commit one second before to remove the use of Array.indexOf |
|
Nevermind :) |
720b02e to
b20ffaa
Compare
b20ffaa to
74018f2
Compare
|
Rebased and green :) |


Fix #3604.
I had a quick break.
Bubbling from marker is supposed to be the default, now, so I just stopped the event on
_openPopup.I could also just add it on
bindPopup, if you prefer this pattern.