-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Selecting non-existent option throws error in v1.13.10 #2263
Comments
It shouldn't ever be possible for a single select to not have a selected option (i.e. selectedIndex should never be -1). That being said, what should be possible, and what is actually possible are often different. Could you provide me with an example? Or let me know the browser you are encountering this issue with? |
Hi, Don't know if this helps but I'm having the same issue when using version 1.13.10 but I DONT have the issue when using 1.13.9. I'm not using data-live-search but it's happening in IE11 & Chrome on any single select list with nothing selected. |
I tried working with this last night on a jsfiddle but could not re-create it. I will check what version of bootsrtap-select it is using and see what I can do to duplicate it |
I have the same issue. My unchanged code doesn't work with 1.13.10 but does work with 1.13.9. |
Same problem :( Here's an example: https://jsfiddle.net/bp9hy1sz/ |
Thank you! Not sure why I could not get my jsfiddle to work. |
Same issue here. Works with 1.13.9, not with 1.13.10. Setting data-title is a work around. |
Another solution would be to add an empty option tag with selected attribute. |
Released in v1.13.11! |
The system assigns the previous selected option to a variable, then sets selected to false. But if that value is -1, an undefined variable causes the code to crash.
This occurred anywhere I was using a data-live-search=true value and there was no default selection value. The fix is to simply check for undefined on the variable
The text was updated successfully, but these errors were encountered: