trimox / angular-mdc-web

Angular wrapper for Material Design (Web) Components
https://trimox.github.io/angular-mdc-web
MIT License
518 stars 87 forks source link

[text-field] When required is set an asterisk (*) is added to the label even if there is no label #2216

Closed tinybigideas closed 4 years ago

tinybigideas commented 4 years ago

Describe the bug If required is set for the component it adds an asterisk (*) to the label even if there is no label. If you are using an external label, this looks very odd.

To Reproduce Steps to reproduce the behavior:

  1. <mdc-text-field outlined required></mdc-text-field>
  2. See error

Expected behavior I would expect it to check if there is a label. If so, append asterisk (*) as per spec. If there is no label, don't append.

Screenshots

image

(Looks bad when an external label is used without a floating label)

What Angular MDC version are you using? 5.1.1

tinybigideas commented 4 years ago

Closing, looks like to an MDC issue, will defer to: https://github.com/material-components/material-components-web/issues/1363

trimox commented 4 years ago

Reopening. @tinybigideas Thanks for reporting on this. There was a time I had this working, will review..

trimox commented 4 years ago

Got it.

https://github.com/trimox/angular-mdc-web/blob/master/packages/notched-outline/notched-outline.html#L3