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

Closed
zdimaz opened this issue Feb 26, 2024 · 4 comments · Fixed by #1166
Closed

Placeholder not showing #1145

zdimaz opened this issue Feb 26, 2024 · 4 comments · Fixed by #1166
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
Contributor

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
  }

@Xon
Copy link
Collaborator

Xon commented Aug 6, 2024

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 Xon linked a pull request Aug 6, 2024 that will close this issue
9 tasks
@Xon Xon closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants