Created
October 30, 2015 10:07
-
-
Save wafs/efb5ef1f560dcfe555d5 to your computer and use it in GitHub Desktop.
If you're trying to bind a select box and you have select2 implemented,
you're gonna have a bad time. Do this and it should fix most things with select dropdowns.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helper for Select2, since bind.js uses input events and select2 uses onchange. | |
var inputChangeEvent = new Event('input'); | |
$('select').on("select2:select", function(e){ | |
e.currentTarget.dispatchEvent(inputChangeEvent); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment