Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder not showing #1145

Open
zdimaz opened this issue Feb 26, 2024 · 3 comments
Open

Placeholder not showing #1145

zdimaz opened this issue Feb 26, 2024 · 3 comments
Labels

Comments

@zdimaz
Copy link

zdimaz commented Feb 26, 2024

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

@zdimaz zdimaz added the bug label Feb 26, 2024
@ahmedtoolapp
Copy link

ahmedtoolapp commented Mar 15, 2024

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
Copy link

can't you use "placeholderValue" config option?

@Alexbrazdasilva
Copy link

In my case, an option with this definition resolved:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants