When I attach jquery select2 to a <select>
that already has an option selected, the dropdown does not show the selected option. If I choose a new option, close the dropdown, then re-open it, the dropdown does show the option.
Example fiddle here: https://jsfiddle.net/9tf2nx8L/1/
Steps to reproduce:
- Notice "5" is selected in the markup
- Click the select2 box
- Notice how the list of options starts at the top
- Click another option.
- Click outside the dropdown, causing it to disappear
- Click the select2 box again
- Notice how the list of options has scrolled to have your newly selected option visible
I'm thinking this is a bug report, but wanted to sanity-check it with SO first.