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.

(Bug) .mat-form-field-underline not rendering in Webkit browsers

See original GitHub issue

First off – thanks for the all the great code!

Bug, feature request, or proposal:

The line underneath the input in a form field (any type of form field) with the class .mat-form-field-underline is sometimes absent from Webkit browsers. It renders as expected at any zoom level and any size screen or device on Firefox, but with Chrome and Safari it’s completely random. For example, I have a list in my application using the plain ol’ input and datepicker elements. Some of them have underlines, some of them don’t. It’s different which ones are working and which aren’t on any given render.

I thought it may have something to do with the height being changed to 0.99px in Chrome, but even setting the height to 1.1px !important using ::ng-deep doesn’t fix it permanently. Something that may help is that when I use that 1.1px height trick, some lines look extra thick, while others just look normal. I would think maybe those normal looking ones are the ones that would be absent without explicitly setting the height, but then again, sometimes they disappear altogether.

What is the expected behavior?

The underlines would show up all the time, no matter what.

What is the current behavior?

Unpredictable rendering for underlines.

What are the steps to reproduce?

https://plnkr.co/edit/kmjxWTwC6sSrkSnDVoGQ?p=preview

Check out this Plunker on Chrome and zoom in and out, resize your window, refresh the page a bunch of times, eventually the underline will disappear. For me, 80% is a pretty reliable way to make it disappear, but I’m sure it’s different everywhere (different screens, devices, etc.). I wish I could provide more info, but it is truly random.

What is the use-case or motivation for changing an existing behavior?

Using the input. : /

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Webkit browsers.

Is there anything else we should know?

Again, great library. Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
mmalerbacommented, Oct 5, 2017

Played around with it and adding transform: perspective(1px) seems to fix in chrome ¯\_(ツ)_/¯

2reactions
willshowellcommented, Oct 3, 2017

Can corroborate from your plunker at 80% and 67%

undline-demo

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Bug) .mat-form-field-underline not rendering in Webkit browsers
mat-form-field-underline is sometimes absent from Webkit browsers. It renders as expected at any zoom level and any size screen or device on ...
Read more >
Rendering bug in WebKit browsers - javascript - Stack Overflow
The most strange thing is that such a position of the block is not based on values of CSS properties as shown by...
Read more >
138876 - Pages Not Rendering Until Window Moves - chromium
The fix was to add -webkit-transform: translateZ(0); on the element. I heard that bug may have something to do with a switch between...
Read more >
5566 – ALT attribute value sometimes not displayed when ...
This bug is about displaying ALT text for missing images only - resources that the browser tried to fetch, and got HTTP code...
Read more >
Chrome just got darker | Clagnut by Richard Rutter
Investigation into, and a fix for a peculiar bug in Mac-based Webkit browsers, including Safari and Chrome. 14 August 2014. When good type...
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