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

Closed
stevenyxu opened this issue Mar 14, 2019 · 2 comments

Comments

@stevenyxu
Copy link
Contributor

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.

84zLDOjNjAY

What is the current behavior?

There are two spaces.

stackblitz

https://stackblitz.com/edit/angular-h3fng3?file=app/form-field-label-example.html

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

https://github.com/angular/material2/blob/master/src/lib/form-field/form-field.html#L55

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

https://github.com/angular/material2/blob/master/src/lib/form-field/form-field.scss#L98

What are the steps to reproduce?

https://stackblitz.com/edit/angular-h3fng3?file=app/form-field-label-example.html

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.

@josephperrott
Copy link
Member

Closed by #15490

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants