Skip to content
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

mat-form-field required asterisk has preceding   that fails to collapse with prior whitespace #15489

stevenyxu opened this Issue Mar 14, 2019 · 0 comments


None yet
1 participant
Copy link

stevenyxu commented Mar 14, 2019

What is the expected behavior?

When a <mat-label> has trailing whitespace (e.g., due to a formatter putting </mat-label> on a new line and the template compiler not collapsing whitespace) and the field is required, there should be one space between the label and the asterisk.


What is the current behavior?

There are two spaces.


mat-form-field adds &nbsp;* to the label when the field is required.

The surrounding .mat-form-field-label already has white-space: nowrap so &nbsp; doesn't serve any additional nowrapping function I know of.

What are the steps to reproduce?

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

Current, since at least d6fec35. All browsers in theory, though I haven't tested.

Is there anything else we should know?

I'll send a PR to see how it integrates. It'll likely trivially break many screendiff tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.