Describe the bug
If you have a <select> where an <option> has selected="selected" by default and then you open that Choices select, close it again without having selected a new option and then open it again, the default selection gets "lost".
To Reproduce
This can be reproduced with one of the examples on https://choices-js.github.io/Choices/. Specifically, go down to the Form interaction example and do the following on the first form:
- Open the select.
- Press arrow key down to select "Option 3".
- Close the select via Esc or by clicking outside.
- Open the select again.
- Press arrow key down to select "Option 3".
It actually selects "Option 1".
Conversely you can also do the following:
- Open the select.
- Press arrow key down to select "Option 3".
- Confirm the "Option 3" selection with Enter.
- Open the select again.
- Press arrow key down to select "Option 4".
It actually selects "Option 1".
Expected behavior
Any time when opening the select, the currently selected item should coincide with the "active" item. Not just when the select is opened for the first time after a page load.
Choices version and bundle
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox 147.0.1
Describe the bug
If you have a
<select>where an<option>hasselected="selected"by default and then you open that Choices select, close it again without having selected a new option and then open it again, the default selection gets "lost".To Reproduce
This can be reproduced with one of the examples on https://choices-js.github.io/Choices/. Specifically, go down to the Form interaction example and do the following on the first form:
It actually selects "Option 1".
Conversely you can also do the following:
It actually selects "Option 1".
Expected behavior
Any time when opening the select, the currently selected item should coincide with the "active" item. Not just when the select is opened for the first time after a page load.
Choices version and bundle
Desktop (please complete the following information):