Placeholder is not visible
See original GitHub issueHello,
I have added the placeholder text to “ng-select” like it was mentioned in the docs,
<ng-select
[options]="options"
[multiple]="true"
placeholder='My Placeholder'
formControlName="control_name">
</ng-select>
However the placeholder does not show up initially, the select itself is working fine with the dropdown and all but the placeholder remains blank until I select some options from the dropdown and then remove them all at this point the placeholder text in the attribute shows up. Not sure what’s wrong…
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
input placeholder is not showing - Stack Overflow
add one more attribute placeholder="Hello". so when the page loads then placeholder will show. <input type="tel" name="natid" id="natid" ...
Read more >Input placeholder not visible
Hi Gareth, You can change the visibility of the placeholder text, by adding this CSS to your app: The first input, has 'enabled'...
Read more >Placeholder not appearing in textbox - HTML-CSS
I have no idea why this is happening. Placeholder shows up properly in the textbox of type “number” called Age. It seems to...
Read more >placeholder-shown - CSS-Tricks
:placeholder-shown , being a pseudo-class, has to select an existing element. It selects the input whenever you're in the placeholder-showing ...
Read more >:placeholder-shown - CSS: Cascading Style Sheets | MDN
The :placeholder-shown CSS pseudo-class represents any <input> or <textarea> element that is currently displaying placeholder text.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well turns out the ng-select’s input element had an initial width of just 1px which is why the placeholder wasn’t visible, once an option was selected the width increased and hence it was visible later on. I couldn’t update the style/css of the input element using
[ngStyle]
I had to override the style block in mystyle.css
to make it work,By setting <ng-select> property from [multiple]=“false” to [multiple]=“true” ,placeholder will be show at initially also,that works for me.