Skip to content

fix(form-field): fix underline at different zoom levels #7567

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 1 commit into from
Oct 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib/form-field/form-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ $mat-form-field-underline-height: 1px !default;
position: absolute;
height: $mat-form-field-underline-height;
width: 100%;
// Prevents underline from disappearing at lower zoom levels.
transform: perspective(1px);
Copy link
Member

@crisbeto crisbeto Oct 6, 2017

Choose a reason for hiding this comment

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

I'm not sure whether this fixes the issue. The only way I managed to break it on my machine was to zoom out to 33% and these changes don't seem to help

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its a little weird, they don't all seem to break, I think it has to do with their vertical position or something. I saw some of them broken at 90% on the input demo page, this fixes it for >= 50% which I think is reasonable

Copy link
Member

Choose a reason for hiding this comment

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

I think that it all depends on your OS/Screen size/Browser combo and whether it hits some weird value that doesn't round off correctly. We could get this in and see if people still see 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.

Yeah, I suspect this will fix it, it does for me


&.mat-disabled {
background-position: 0;
Expand Down