Skip to content

fix(form-field): inconsistent underline height at different DPIs #11062

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

Merged
merged 2 commits into from
May 1, 2018

Conversation

mmalerba
Copy link
Contributor

No description provided.

@mmalerba mmalerba added pr: needs review target: patch This PR is targeted for the next patch release labels Apr 28, 2018
@mmalerba mmalerba requested a review from crisbeto April 28, 2018 17:46
@mmalerba mmalerba requested a review from jelbourn as a code owner April 28, 2018 17:46
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 28, 2018
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -144,6 +144,8 @@ $mat-form-field-default-infix-width: 180px !default;
width: 100%;
// Need this so that the underline doesn't block the hover effect.
pointer-events: none;
// We transform the height slightly higher to fix inconsistent underline height for some DPIs.
transform: scaleY(1.0001);
Copy link
Member

Choose a reason for hiding this comment

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

This feels like one of those things where it only really helps at certain screen sizes and/or DPIs. I don't think it would hurt having it, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it out at different zoom levels on my desktop and retina macbook and this definitely helped make things more consistent and made the underlines not disappear on zoom levels between 50% and 100%

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Apr 29, 2018
@@ -144,6 +144,8 @@ $mat-form-field-default-infix-width: 180px !default;
width: 100%;
// Need this so that the underline doesn't block the hover effect.
pointer-events: none;
// We transform the height slightly higher to fix inconsistent underline height for some DPIs.
transform: scaleY(1.0001);
Copy link
Member

Choose a reason for hiding this comment

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

Are you able to elaborate on why adding this scale resolves the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At zoom levels between 50% and 100% some of the form-fields would lose their underline and some would have 1px underline. It seemec related to fractional pixels in some way (e.g. underlines with their top at x.7px were fine, but underlines at x.8px disappeared). The exact fractions that worked or didn't work seemed to depend on the users resolution and zoom level.

This was basically just a hunch "hey maybe making the underline barely thicker will somehow help." And on all the screens and zoom levels I tested it did indeed fix the problem. It also fixed the case where you're zoomed in to >100% and the underlines would have inconsistent thickness.

Copy link
Member

Choose a reason for hiding this comment

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

Add the gist of that to the comment?

@josephperrott josephperrott added pr: needs review and removed pr: lgtm action: merge The PR is ready for merge by the caretaker labels May 1, 2018
@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels May 1, 2018
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@josephperrott josephperrott merged commit 0f7d503 into angular:master May 1, 2018
@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants