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

Selects with dropkick applied do not bubble change events correctly #303

Closed
jamesnw opened this issue Jul 2, 2015 · 4 comments
Closed

Comments

@jamesnw
Copy link

jamesnw commented Jul 2, 2015

Expected behavior- Selects would bubble change events in the same way whether or not they have dropkick applied.

Discovered behavior- Selects with dropkick applied calls the change event for the select itself, but nothing above.

I was not able to get a JSFiddle working with dropkick, so here is an html file that demonstrates what I'm experiencing-

http://up.jamesnweber.com/_sandbox/dropkick/index.html (gist at https://gist.github.com/jamesnw/f98fe067a48ac2922143)

If you change the select with dropkick applied, the change event is only called on the select, and then it stops.

If you change the select without dropkick applied, the change event bubbles up correctly.

@jamesnw
Copy link
Author

jamesnw commented Jul 6, 2015

I was able to make things work with the following code-

$('select').dropkick({'change':function(){
    $(this.form).find('select').change();
}});

However, this isn't perfect, as it calls change on the select, bubbles correctly, and then calls change on the select again, but this time it doesn't bubble. Is there a better way of doing this?

@spoonben
Copy link

spoonben commented Jul 7, 2015

This was addressed in #302.

@Robdel12
Copy link
Owner

Robdel12 commented Jul 7, 2015

Cool. I'll close it :)

@Robdel12 Robdel12 closed this as completed Jul 7, 2015
@jamesnw
Copy link
Author

jamesnw commented Jul 7, 2015

Thanks for addressing this in a more robust way than my workaround! (And sorry for the duplicate issue)

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