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 displaying for empty string

See original GitHub issue

Is your feature request related to a problem? Please describe. When a formControl is passed into ng-select with a value of '', placeholder is not getting displayed.

Describe the solution you’d like I think that placeholder should be displayed when '' is the current value, or placeholder should be passed a function that lets the user decide when placeholder should be displayed or not.

Describe alternatives you’ve considered Constructing a formControl with a default of null solves this, but it would make sense for '' to be treated the same way.

Thanks!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Iuriy-Budnikovcommented, Oct 7, 2022

angular = 💩

1reaction
baby-bibincommented, Jun 17, 2019

Is there any way to show placeholder, if the ngModel is an empty string (‘’) ?? Like in the previous versions…,

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Check if string is empty inside a placeholder tag?
I have this input field and it has a placeholder tag. I need to check if the variable which goes inside placeholder tag...
Read more >
placeholder - CSS: Cascading Style Sheets - MDN Web Docs
The ::placeholder CSS pseudo-element represents the placeholder text in an or element.
Read more >
Placeholders - The jQuery replacement for select boxes
Select2 supports displaying a placeholder value using the placeholder configuration option. The placeholder value will be displayed until a selection is made.
Read more >
Experience editor does not show the empty placeholder ...
When we add any component in empty placeholder in experience editor and then remove the component, we do not see the the empty...
Read more >
CSS ::placeholder and :placeholder-shown
If you wanted to add styles for empty placeholder, we can pass empty string " " as placeholder. <input type="text" placeholder=" " /> ......
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