Placeholder not showing
zdimaz opened this issue · comments
zdimaz commented
new Choices(element, {
searchEnabled: true,
removeItemButton: true,
placeholder: true, // or text !
allowHTML: true,
itemSelectText: '', // Press to select
noChoicesText: 'No choices',
});
Select has attr
options
But rendered input not
ahmedtoolapp commented
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
Stefan Korn commented
can't you use "placeholderValue" config option?
alexbrazreal commented
In my case, an option with this definition resolved:
{
label: "Pick a item",
placeholder: true,
disabled: true,
value: -1, // Or null
}