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

Reveal accidentally unbound all event handlers when openOn option is '' #74

Closed
qc00 opened this issue Jun 1, 2012 · 2 comments
Closed
Labels

Comments

@qc00
Copy link

qc00 commented Jun 1, 2012

I have traced down the problem to the line:
base.$el.unbind( (o.openOn) ? o.openOn + '.keyboard' : '');

Apparently there is an undocumented behavior in jQuery where when the argument to unbind() is empty string, all event handlers are removed. This should be the behavior for unbind() with no arguments, but obviously they didn't do enough checking.

I made a jsfiddle for this. This unexpected behavior started as early as version 1.4.4.

I propose the following fix:

if (o.openOn) { base.$el.unbind( o.openOn + '.keyboard'); }

@Mottie
Copy link
Owner

Mottie commented Jun 1, 2012

Thanks for sharing this issue! I'll include your fix in the next update!

@Mottie Mottie closed this as completed in beb9247 Jun 17, 2012
@Mottie
Copy link
Owner

Mottie commented Jun 18, 2012

Thanks again billccn! I've added your recommendations in the latest version 1.9.19. I appreciate the help :)

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

No branches or pull requests

2 participants