Skip to content

Conversation

fastrde
Copy link
Contributor

@fastrde fastrde commented Aug 9, 2013

Deleted one line from L.Popup to fix the issue described in Issue #1925
The click events doesn't propagate to the map when you click the close button so the _fakeStop called in disableClickPropagation disable the first real mapClick.

I tested propagation in Firefox 22 and Chrome 28.0.1500.95 and it seems to work.

lg

fastrde

@ghost ghost assigned mourner Aug 15, 2013
@fastrde
Copy link
Contributor Author

fastrde commented Aug 18, 2013

hmm. The deleted Line was added 5 month ago to fix a bug with a yellow border around the close button. See #1537.
But i didn't get what clickpropagation have to do with the button highlighting by border.
And i didn't get the border. Was this an IE bug?

@danzel
Copy link
Member

danzel commented Aug 18, 2013

Maybe android? That yellow looks like an android thing.

@mourner
Copy link
Member

mourner commented Aug 18, 2013

Maybe lets just replace it with stopPropagation? It would fix the current issue while not affecting the previous close button fix in theory.

@fastrde
Copy link
Contributor Author

fastrde commented Aug 19, 2013

Ok. It's an Android Issue with the border and I can reproduce it in the linked fiddle. I'll try to call stopPropagation.

Lg

fastrde

@fastrde
Copy link
Contributor Author

fastrde commented Aug 19, 2013

stopPropagation is already called. The problem is that _skipped not resets when propagation is stopped.

@mourner
Copy link
Member

mourner commented Aug 19, 2013

Oh, now I get what you mean. But I think there's no need to introduce a public disableFakeStop method since it won't be used anywhere outside. stopPropagation is the only method that causes skipped not to get reset so it's enough to reset it inside stopPropagation (not just stop btw).

@mourner
Copy link
Member

mourner commented Aug 19, 2013

(had typo in prev comment, fixed to stopPropagation)

@fastrde
Copy link
Contributor Author

fastrde commented Aug 19, 2013

Testcase at http://www.fastr.de/tests/leaflet-clickfix.html
Think this should work now for both issues.

@mourner
Copy link
Member

mourner commented Aug 19, 2013

Looks good! But it still removes disableClickPropagation from the close button (which initially fixed the border issue). Should it be removed?

@fastrde
Copy link
Contributor Author

fastrde commented Aug 20, 2013

thx again for the close look. I've concentrated me on L.DomEvent and overlooked the missing line.
Line Added. Testcase updated.

@@ -143,7 +143,7 @@ L.Popup = L.Class.extend({
closeButton.href = '#close';
closeButton.innerHTML = '×';
L.DomEvent.disableClickPropagation(closeButton);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing space :)

@mourner
Copy link
Member

mourner commented Aug 20, 2013

Nice! Now that this small change built into a lot of commits, could you please rebase it into one commit (only including DomEvent fixes, without whitespace changes in Popup?)

@fastrde
Copy link
Contributor Author

fastrde commented Aug 20, 2013

so, now i have learned to rebase ;-) and hope it's ready to merge.

mourner added a commit that referenced this pull request Aug 20, 2013
@mourner mourner merged commit 14d934b into Leaflet:master Aug 20, 2013
@mourner
Copy link
Member

mourner commented Aug 20, 2013

Yep! Thanks a lot Fabian :)

@fastrde fastrde deleted the fixSecondClickPopupIssue branch August 20, 2013 19:51
@elentok
Copy link

elentok commented Aug 26, 2013

Hi, any idea when's the next release that will include this fix?

@mourner
Copy link
Member

mourner commented Aug 26, 2013

Not sure, maybe in a few weeks.

@mourner
Copy link
Member

mourner commented Aug 26, 2013

Nothing prevents you from using the master version though.

johnd0e pushed a commit to johnd0e/Leaflet0 that referenced this pull request Jan 29, 2021
johnd0e pushed a commit to johnd0e/Leaflet0 that referenced this pull request Jan 31, 2021
johnd0e pushed a commit to johnd0e/Leaflet0 that referenced this pull request Jan 31, 2021
johnd0e pushed a commit to johnd0e/Leaflet0 that referenced this pull request Jan 31, 2021
mourner pushed a commit that referenced this pull request Feb 8, 2021
* DomEventSpec.js: use on/off instead of add/removeListener aliases

* DomEventSpec.js: use happen.click instead of custom function (for uniformity)

* DomEventSpec.js: minor refactoring

Make use of more `sinon` features (for uniformity with other tests)

* DomEventSpec.js: tests for disableScrollPropagation and disableClickPropagation

DomEvent.js: fix typo

* DomEventSpec.js: test to ensure stopPropagation does not break disableClickPropagation logic

Test case for #1963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants