material-components / material-components-web

Modular and customizable Material Design UI components for the web
https://material.io/develop/web
MIT License
17.12k stars 2.15k forks source link

[MDCTextField] Outlined - w/ Leading Icon - Label gap incorrect when focused and has a prefilled value #5110

Open williamernest opened 4 years ago

williamernest commented 4 years ago
  1. Go to https://storage.googleapis.com/mdc-web-screenshot-tests/travis/2019/05/29/18_06_17_850/spec/mdc-textfield/classes/baseline-leading-icon.html?utm_source=golden_json (latest golden screenshot)

  2. Focus the bottom textfield that has a pre-filled value.

  3. Notice the size of the gap for the label.

image

abhiomkar commented 4 years ago

Findings from my initial investigation:

image

abhiomkar commented 4 years ago

Sent potential fix (PR #5111). But I curious history of the following commit that reverts offsetWidth to scrollWidth, was there any reason for choosing scrollWidth over offsetWidth or clientWidth?

--> https://github.com/material-components/material-components-web/pull/4171/commits/c3fc1d007810eb8688d300cd73521fcc16b118e3