-
Notifications
You must be signed in to change notification settings - Fork 634
Open
Labels
Description
Describe the bug
When initializing a single select that has a placeholder and the possibility to remove options, the initial value of the select is the first element of the list.
To Reproduce
https://jsfiddle.net/anvf51L4/
Expected behavior
Since the value of the dropdown is manually set to '' upon selection removal, I would expect the same behavior to be replicated on initialization. The piece of code I'm referring to:
Choices/src/scripts/reducers/items.ts
Lines 44 to 48 in 38ab095
// For a select-one, if all options are deselected, the first item is selected. To set a black value, select.value needs to be set | |
const select = el.parentElement; | |
if (select && isHtmlSelectElement(select) && select.type === PassedElementTypes.SelectOne) { | |
select.value = ''; | |
} |
Choices version and bundle
- Version: v11.1.0 choices.min.js
Desktop (please complete the following information):
- OS: Windows 11
- Browser: edge
- Version: 139