question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Placeholder not show on first load

See original GitHub issue

Describe 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

  1. When go to the page select
  2. Then click remove icon select2

Desktop (please complete the following information):

  • OS: windows10
  • BrowserChrome

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
CanerDemircommented, Feb 14, 2019

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 to null , the issue solved.

1reaction
luis-abenocommented, Feb 14, 2019

Thanks @CanerDemir, it worked 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found