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

Use Disabled Option as "Placeholder" #41

Closed
wydflannery opened this issue Sep 19, 2016 · 2 comments
Closed

Use Disabled Option as "Placeholder" #41

wydflannery opened this issue Sep 19, 2016 · 2 comments

Comments

@wydflannery
Copy link

wydflannery commented Sep 19, 2016

Would it be possible to have this plugin work with a disabled attribute so an <option> can be used as a placeholder? In a traditional <select> you could do the following to achieve this:

<select id="dropdown-save-to-project" class="form-control">
    <option disabled selected>Choose Project..</option>
    <option>Project #1 </option>
    <option>Project #2</option>
    <option>New Project</option>
</select>

When using choices, the <select> is shown empty until a non-disabled element is selected. I also tried using the built in placeholder/placeholderValue options but could not get it working with a single select input and didn't see any examples on the demo page.

(I also think this would degrade nicely if you opted to use a traditional <select> for mobile.)

@jshjohnson
Copy link
Collaborator

Hi @wydflannery,

As of version 2.0.6, setting a disabled option as a placeholder item will now work.

Thanks

@wydflannery
Copy link
Author

I really appreciate it, thank you!

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

No branches or pull requests

2 participants