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.

different style for placeholder text

See original GitHub issue

We would like to be able to apply a different style to the placeholder text than we do to the text for the selected items. Perhaps this could be achieved by applying a different class to the span element.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
PriyanshDwivedicommented, Nov 26, 2020

This

I will explain what i have done in my scenario which was the case of form arrays.

  1. Once the value is selected , the corresponding form array value will be set.
  2. It is possible to distinguish between empty span and selected span by using a [ngClass] in once value in the array set. For example ,

.selected span { color:black }

[ngClass]="{'selected':data.value.alternateskill?.id}"

I was checking whether the id is set or not . Id will be set once value is selected. I think the same can be applied to ngModel as well.

This is brilliant. Thanks a ton for this hack. Haven’t tried it yet but will definitely work.

1reaction
SandeepBalachandrancommented, Nov 26, 2020

I will explain what i have done in my scenario which was the case of form arrays.

  1. Once the value is selected , the corresponding form array value will be set.
  2. It is possible to distinguish between empty span and selected span by using a [ngClass] in <ngx-select-dropdown> once value in the array set. For example ,

.selected span { color:black }

[ngClass]="{'selected':data.value.alternateskill?.id}"

I was checking whether the id is set or not . Id will be set once value is selected. I think the same can be applied to ngModel as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

placeholder - CSS: Cascading Style Sheets - MDN Web Docs
Placeholder text will appear with the same styling as user-entered text content when rendered in Windows High Contrast Mode. This will make it ......
Read more >
CSS ::placeholder Selector - W3Schools
The ::placeholder selector selects form elements with placeholder text, and let you style the placeholder text. The placeholder text is set with the ......
Read more >
::placeholder | CSS-Tricks - CSS-Tricks
:placeholder-shown is for selecting the input itself when it's placeholder text is being shown. As opposed to ::placeholder which styles the ...
Read more >
Multiple styles for input placeholder text - Stack Overflow
I can't seem to successfully combined the css above with classes or and other type of element selector. All the tutorials I've found...
Read more >
How to Style the Placeholder Text - OptinMonster
You can style other aspects of your placeholder, however, we would encourage you to keep styles minimal when it comes to modifying the...
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