Choices
Choices copied to clipboard
Placeholder not showing
new Choices(element, { searchEnabled: true, removeItemButton: true, placeholder: true, // or text ! allowHTML: true, itemSelectText: '', // Press to select noChoicesText: 'No choices', }); Select has attr
But rendered input not
select element does not have placeholder natively You have two options :
- Using input type="text" instead of select
- Keep select and add new empty option to choices/items array
can't you use "placeholderValue" config option?
In my case, an option with this definition resolved:
{
label: "Pick a item",
placeholder: true,
disabled: true,
value: -1, // Or null
}
can't you use "placeholderValue" config option?
Sadly there are a bunch of cases where this will be ignored. The plan is it will be fixed in v11.0.0 once I get that branched merged in. For now v11.0.0RC4 is tagged on my fork.