Skip to content
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

"hidden" event propagation can cause troubles with other components #60

Closed
tgirardi opened this issue Nov 27, 2012 · 1 comment
Closed

Comments

@tgirardi
Copy link
Collaborator

(First of all: @jdewit, it's the first time I write to you, so let me say that this datepicker plugin is excellent and super-useful!)

Datepicker triggers the "hidden" event under certain circumstances. The problem is that other elements, up in the DOM tree could be listening for that event also and, because datepicker doesn't stop the propagation of the event after handling it, those elements receive the event and could act in unexpected ways.

In my particular case, there was a listener ready to .remove() a popup after the "hidden" event is triggered on the popup. When a datepicker inside that popup is closed, the corresponding "hidden" event gets fired, "climbs" up the DOM tree, gets to my popup and the popup is unwillingly removed.

However, probably this is the way datepicker is supposed to work... I'm not sure. It could be the user's responsibility to check if the event triggered is really the one it's been expecting (like I did: checked if event.target == event.currentTarget before removing the popup... that condition is not met when datepicker closes), or it could be the plugin's responsibility to stop the propagation if the event is ment for it.

Hope this is helpful :-)

@topa
Copy link

topa commented Jan 21, 2013

Same problem for "hide"-Event in "hideWidget"-method (about line 140).

@jdewit jdewit closed this as completed in e764908 Jan 30, 2013
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

No branches or pull requests

3 participants