Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox md-input placeholder text doesn't appear above user input #342

Closed
dozingcat opened this issue Apr 23, 2016 · 2 comments
Closed

Firefox md-input placeholder text doesn't appear above user input #342

dozingcat opened this issue Apr 23, 2016 · 2 comments
Labels
help wanted The team would appreciate a PR from the community to address this issue P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Milestone

Comments

@dozingcat
Copy link
Contributor

  • Do you want to request a feature or report a bug?
    Bug
  • What is the current behavior?
    Run the demo app in Firefox, or go to https://material2-app.firebaseapp.com/ . Click on a text field with placeholder text. The placeholder text will turn blue but remain in the same place. Start typing and the placeholder text will disappear entirely.
  • What is the expected behavior?
    Chrome behaves correctly; when the text field becomes focused, the placeholder text should animate above the entered text.
  • Which version of Angular and Material, and which browser and OS does this issue affect?
    Behavior is identical in Firefox 45 on Mac OS X 10.11, Windows 10, and Android. Running against material2 head.
  • Other information
    Commenting out the "input:-webkit-autofill + .md-input-placeholder" selector in input.scss (https://github.com/angular/material2/blob/master/src/components/input/input.scss#L140) makes Firefox work as expected. Apparently Firefox believes "input:-webkit-autofill" is invalid CSS and won't apply any selectors that contain it.
@jelbourn jelbourn added the P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful label Apr 24, 2016
@jelbourn jelbourn added this to the alpha.4 milestone Apr 24, 2016
@jelbourn jelbourn added the help wanted The team would appreciate a PR from the community to address this issue label Apr 24, 2016
@davidgabrichidze
Copy link
Contributor

davidgabrichidze commented May 5, 2016

One option is to split webkit-autofill and other selectors from each other. This will duplicate several lines of css, but will work for firefox, without affecting chrome/safari autofill behavior.

e.g. rendered css which works as expected
`[_nghost-dxv-12] .md-input-placeholder.md-float:not(.md-empty), [_nghost-dxv-12] .md-input-placeholder.md-float.md-focused, [_nghost-dxv-12] .md-input-placeholder {
visibility: visible;
padding-bottom: 5px;
-webkit-transform: translateY(-100%) scale(0.75);
transform: translateY(-100%) scale(0.75); }
[_nghost-dxv-12] .md-input-placeholder.md-float:not(.md-empty) .md-placeholder-required, [_nghost-dxv-12] .md-input-placeholder.md-float.md-focused .md-placeholder-required, [_nghost-dxv-12] .md-input-placeholder .md-placeholder-required {
color: #9c27b0; }

[_nghost-dxv-12] input:-webkit-autofill + .md-input-placeholder {
visibility: visible;
padding-bottom: 5px;
-webkit-transform: translateY(-100%) scale(0.75);
transform: translateY(-100%) scale(0.75); }
[_nghost-dxv-12] input:-webkit-autofill + .md-input-placeholder .md-placeholder-required {
color: #9c27b0; }`

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted The team would appreciate a PR from the community to address this issue P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
Development

No branches or pull requests

4 participants