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

How to hide placeholder from the list? #89

Closed
lavezzi1 opened this issue Dec 15, 2016 · 6 comments
Closed

How to hide placeholder from the list? #89

lavezzi1 opened this issue Dec 15, 2016 · 6 comments
Labels

Comments

@lavezzi1
Copy link

Hello everyone,

I want to hide the placeholder from the list (choices list) is this possible?

@jshjohnson
Copy link
Collaborator

Hi,

Could you send a screenshot to illustrate what you mean please? Thanks :)

@lavezzi1
Copy link
Author

lavezzi1 commented Dec 15, 2016

@jshjohnson I want to hide this item 'This is placeholder' because it looks very weird.

screen shot 2016-12-15 at 16 22 07

@jshjohnson
Copy link
Collaborator

So the example you set is using the following HTML:

<select class="form-control" data-trigger name="choices-single-default" id="choices-single-default" placeholder="This is a search placeholder">
  <option selected disabled>This is a placeholder</option>
  <option value="Dropdown item 1">Dropdown item 1</option>
  <option value="Dropdown item 2">Dropdown item 2</option>
  <option value="Dropdown item 3">Dropdown item 3</option>
</select>

To remove the This is a placeholder, you just need to remove

<option selected disabled>This is a placeholder</option>

Thanks

@lavezzi1
Copy link
Author

@jshjohnson I didn't say that I want to remove it, I want to HIDE it. I want to keep placeholder.

@jshjohnson
Copy link
Collaborator

Ah apologies. That's currently not possible but is in the works here.

@studio404pl
Copy link

studio404pl commented Mar 3, 2017

@lavezzi1
I didn't have enough time to wait for new release with that improvement so you can add this css to make disabled field dissapear from the list:

.choices .choices__list .choices__list .choices__item--disabled { text-indent: -9999px; height: 0; width: 0; padding: 0; }

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

3 participants