Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(form-field): jumping underline in Edge and Firefox #8480

Merged

Conversation

devversion
Copy link
Member

  • In Edge and Firefox the underline jumps due to the transform: perspective. Also due to the transform the underline is getting slightly taller which isn't aligning with the specs.
  • Improves rendering of the ripple underline by always setting the 2px height. Since the element only shows in focus-stated the height can be always 2px.

Note: The perspective(1px) might have fixed the zoom-out issue on some browsers, but it
introduces more issues than it helps (e.g. Firefox 57, Edge). Also the fix is not actually right. It just adds some subpixels to the 1px underline and therefore makes it easier for the browser to render in some circumstances the zoomed-out element (conflicts with the Material Design specification of 1px).

Fixes #8395

@devversion devversion requested a review from mmalerba as a code owner November 16, 2017 15:04
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 16, 2017
@devversion devversion force-pushed the fix/form-field-jumping-underline branch from 2d47cfd to 7dc6027 Compare November 16, 2017 16:54
@mmalerba
Copy link
Contributor

There might be no way to fix it and still make other browsers happy, but here's some examples from Chrome of why I added this in the first place:

Input demo page at 90%:
90
Input demo page at 90% with perspective transform:
90-perspective
Input demo page 110%:
110
Input demo page 110% with perspective transform:
110-perspective

* In Edge and Firefox the underline jumps due to the `transform: perspective`. Also due to the `transform` the underline is getting slightly taller which isn't aligning with the specs.
* Improves rendering of the ripple underline by always setting the 2px height. Since the element only uses `1px` if there are form-field errors the height can be adjusted on errors instead of on every focus/blur.

Fixes angular#8395
@devversion devversion force-pushed the fix/form-field-jumping-underline branch from 7dc6027 to 0db692c Compare November 16, 2017 17:01
@devversion
Copy link
Member Author

Are those screenshots from the current Chrome version? For me everything looks fine from 33%. As said this seems to depend on the screen resolution and Chrome's pixel rendering.

@mmalerba
Copy link
Contributor

Linux, Chrome 62.0.3202.94, 2560x1600

@devversion
Copy link
Member Author

Hmm. Not sure about that. I don't think there is a reasonable fix for such zooming levels. What do you think? @mmalerba

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Nov 17, 2017
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, standard zoom level working on all browsers should take precedence.

@palpatine1991
Copy link

Why not to create a chrome specific SCSS rule using media query?

@palpatine1991
Copy link

palpatine1991 commented Jan 25, 2018

We are facing an issue with the chrome even with zoom set at 100% but some Windows system are apparently set to zoom "125%" by default and also chrome is affected by this.
zoom

@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 8, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seems the underline is jumping on mat-form-field on focusin and focusout in Edge Browser
5 participants