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 Working in single Select #7

Open
faizalshap opened this issue Aug 3, 2017 · 2 comments
Open

Placeholder Not Working in single Select #7

faizalshap opened this issue Aug 3, 2017 · 2 comments

Comments

@faizalshap
Copy link

faizalshap commented Aug 3, 2017

Hi, I have tried giving placeholder in Select2 Options but it doesn't work multiple is set to false however if multiple is set to true, then placeholder works.

I have also viewed in demo and there are no demos which shows Placeholder in single Select.
Also, in single select, by default first option is selected, however value is not selected i.e value is empty.
This is my options var -

  public options: Select2Options = {
    minimumResultsForSearch: 9001,
    placeholder: 'Select project...',
  };

Thanks.

@mchl18
Copy link

mchl18 commented Feb 22, 2018

What worked for ma as quick-and-dirty fix was to first push an item with empty strings to the data array:
{id: '', text: ''}
This enables the placeholder for me so far.

@korisantosh
Copy link

This module support, but dont have documentation.
Here is my finding which can help others

<select2 [options]="{placeholder:'Your Select placeholder'}"

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

No branches or pull requests

3 participants