Placeholder not show on first load
See original GitHub issueDescribe the bug
I use ng-select with template-driven form like:
<ng-select class="env-custom-select" [items]="documentTypeList" bindLabel="description" ngModel name="documentType" placeholder="Doküman Tipi Seçiniz" [searchable]="false" clearAllText="Temizle"> </ng-select>
everything is alright but when i first come to page the select show remove icon now placeholder. When i click remove icon then the placeholder appear. I think it select an empty value or something else.
Expected behavior When first come to page it should show placeholder if any value does not selected.
Screenshots
- When go to the page
- Then click remove icon
Desktop (please complete the following information):
- OS: windows10
- BrowserChrome
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Input field "placeholder" not working/showing - Stack Overflow
I'm a newbie front-end dev, I'm having trouble understanding why the placeholder is not working, I tried using LABEL tag but it won't ......
Read more >:placeholder-shown - CSS: Cascading Style Sheets | MDN
The :placeholder-shown CSS pseudo-class represents any or element that is currently displaying placeholder text.
Read more >Space on the initial load is hiding placeholder te... - ServiceNow
We created a UI Page that shows the Suspended. ... Space on the initial load is hiding placeholder text placed in the textarea...
Read more >Lazy Loading Images – The Complete Guide - ImageKit.io
Lazy loading images that are not in the viewport improves initial page load performance and user experience. This is an in-depth guide to ......
Read more >placeholder-shown - CSS-Tricks
the specs only have :placeholder-shown and not ::placeholder · :placeholder-shown can still affect the styling of the placeholder text, since ...
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 FreeTop 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
Top GitHub Comments
I got it. When using template-driven-form like
ngModel name="documentType"
that, the field default value is “”(empty string). And ng-select suppose that field is has a value and don’t show placeholder. I convert my code to reactive form and set initial value tonull
, the issue solved.Thanks @CanerDemir, it worked 😃