Choices icon indicating copy to clipboard operation
Choices copied to clipboard

Placeholder not showing

Open zdimaz opened this issue 1 year ago • 3 comments

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

zdimaz avatar Feb 26 '24 11:02 zdimaz

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

ahmedtoolapp avatar Mar 15 '24 09:03 ahmedtoolapp

can't you use "placeholderValue" config option?

stefan-korn avatar Mar 19 '24 14:03 stefan-korn

In my case, an option with this definition resolved:

{
    label: "Pick a item",
    placeholder: true,
    disabled: true,
    value: -1, // Or null
  }

Alexbrazdasilva avatar Apr 08 '24 17:04 Alexbrazdasilva

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.

Xon avatar Aug 06 '24 05:08 Xon