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.

Applying a style.color to input placeholder

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/core

Is this a regression?

NO

Description

When adding a [style.color] to an input field, that color is expected to be applied to the input text as well as the placeholder. It seems that the expected behavior is fine on Firefox, but on Chrome the color of the placeholder falls back to default like shown in the Stackblitz example below.

πŸ”¬ Minimal Reproduction

https://stackblitz.com/edit/angular-gvssfb?file=src/app/app.component.html

🌍 Your Environment

Angular Version:




Angular CLI: 7.0.4
Node: 10.18.0
OS: darwin x64
Angular: 7.0.3
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        7.0.4
@angular/cli                      7.0.4
@angular/flex-layout              7.0.0-beta.19
@ngtools/webpack                  6.0.8
@schematics/angular               7.0.4
@schematics/update                0.10.4
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.8.3

Anything else relevant? It occurs on Google Chrome Version 81.0.4044.129 (Official Build) (64-bit). Works fine on Firefox.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pkozlowski-opensourcecommented, May 7, 2020

I’m going to close this issue as it is outside of Angular’s scope and we can’t do anything about the issue here in this project.

2reactions
pkozlowski-opensourcecommented, May 7, 2020

I can effectively see the difference between Chrome and FFox in terms of styling placeholder’s text:

  • it is gray-ish in Chrome
  • it is green-ish in FFox

Having said this, the observed discrepancy has nothing to do with Angular, as I can observe the same effect with vanilla HTML, without any Angular involvement, see: https://stackblitz.com/edit/typescript-ufp1pz?file=index.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Change Input Placeholder Color - W3Schools
In most browsers, the placeholder text is grey. To change this, style the placeholder with the non-standard ::placeholder selector. Note that Firefox adds...
Read more >
placeholder - CSS: Cascading Style Sheets - MDN Web Docs
Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default. Syntax. ::placeholder. AccessibilityΒ ...
Read more >
Change a HTML5 input's placeholder color with CSS
This property allows you to specify a fill color for text. If it is not set, then the color property will be used...
Read more >
Change an HTML5 input placeholder color with CSS
Change an HTML5 input placeholder color with CSS ... Example 1: This code shows the use of ::placeholder selectors in different browsers. HTMLΒ ......
Read more >
How To Change the Color of an HTML5 Input Placeholder ...
The default color of a placeholder text is light grey in most browsers. If you want to change it, you need to use...
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