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

Calling $(document).off(".anything") causes stack blowup aftere loading dropdown #7085

Closed
BJTerry opened this issue Feb 26, 2013 · 1 comment
Labels

Comments

@BJTerry
Copy link

BJTerry commented Feb 26, 2013

In b5ad506 changes were made to bootstrap-dropdown.js which resulted in this (essentially):

$(document).on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })

being changed to this:

$(document).on('.dropdown-menu', function (e) { e.stopPropagation() })

As far as I can tell, you aren't supposed to call .on with a bare namespace as the event name. If you later call $(document).off(".anything") it causes a stack blowup, as the event object in jQuery has an entry with a key of "" which is then treated as a boolean for determining whether to recurse. This looks like a typo in light of the other changes one can see in the file. Here is a minimal example: http://jsfiddle.net/DFyEr/

@BJTerry BJTerry closed this as completed Feb 26, 2013
@BJTerry
Copy link
Author

BJTerry commented Feb 26, 2013

Nevermind, this is a duplicate of #6970

@cvrebert cvrebert added the js label Mar 16, 2015
@twbs twbs locked and limited conversation to collaborators Mar 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants