Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
.prop("selected", true) does not work as expected in IE11 #2732
By selecting option with .prop("select", true), the behavior is not as expected under IE11
Testing with Firefox / Chrome / Safari, the behavior should be consistent,
In IE, however, the result is "Four".
You may comment out Line 11, 12, and/or 14 for more test cases with expected result (last prop being selected) in other browsers, but IE11.
To remove a red herring here, the special characters in the values don't change the outcome. Here is a simpler case, with the last selection changing the text to show that it was able to select the right element: http://jsfiddle.net/zksm1o5q/5/
Here's a bare DOM example without jQuery that exhibits the same problem: http://jsfiddle.net/15ytbys8/
Does that fix the problem? Is it only a bug with options that exist in the select already, or would we also need to guard against ones appended from elsewhere?
This seems to work on Edge so it's only IE11 (and older IEs) affected.
In any event it seems like that might really be a performance killer, especially on selects with a lot of options. I guess it could be limited by a feature detect to only IE and only when changing the