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 displayed for empty dropdown #567

Closed
ckotzbauer opened this issue Apr 3, 2019 · 6 comments
Closed

Placeholder not displayed for empty dropdown #567

ckotzbauer opened this issue Apr 3, 2019 · 6 comments
Labels

Comments

@ckotzbauer
Copy link

I use choices in single-select mode and set placeholder: true, placeholderValue: 'a string'. The placeholder is not displayed in UI if there are no choices. When I add choices later, the placeholder is displayed correctly.
This happens with version 7.0.0

@Colin-Moran
Copy link

I came across this problem since choices.ClearStore() also removes the placeholder item. The solution I'm using is this:

placeholderItem = choices._getTemplate( 'placeholder', 'This is a placeholder' ); choices.itemList.append(placeholderItem);

Where 'choices' is the name of your choices object.

@hg64
Copy link

hg64 commented May 13, 2019

Possibly same issue.... Using clearChoices. Getting a javascript error intermittently on line 2630 placeholderItem.innerHTML = this._placeholderValue || '';

    if (this._isSelectOneElement) {
         placeholderItem.innerHTML = this._placeholderValue || '';
    } else {
      this.input.placeholder = this._placeholderValue || '';
    }

@stale
Copy link

stale bot commented Aug 30, 2019

Thanks for contributing to this issue. As it has been 60 days since the last activity, this issue is being automatically closed. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again!

@stale stale bot added the stale label Aug 30, 2019
@TeraNovaLP
Copy link

@jshjohnson I have the same problem. Is there any update yet?

@stale stale bot removed the stale label Aug 30, 2019
@vitobotta
Copy link

Hi @jshjohnson I am having this issue now. I am fetching items with async ajax and one of the elements returned has the property selected set to true. Is there a fix or workaround for this? Thanks!

@hg64 @Colin-Moran @code-chris pinging you guys too in case you have found a proper solution for this.

@Xon Xon mentioned this issue Aug 6, 2024
9 tasks
@Xon
Copy link
Collaborator

Xon commented Aug 22, 2024

Implemented as part of #1166

@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

No branches or pull requests

7 participants