Skip to content

Conversation

@crisbeto
Copy link
Member

Fixes selecting an option that has a blank string as a label throwing off the alignment of mat-select.

Fixes #11969.

Fixes selecting an option that has a blank string as a label throwing off the alignment of `mat-select`.

Fixes angular#11969.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jun 30, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 30, 2018
@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jul 3, 2018
<span class="mat-select-placeholder" *ngSwitchCase="true">{{placeholder || '\u00A0'}}</span>
<span class="mat-select-value-text" *ngSwitchCase="false" [ngSwitch]="!!customTrigger">
<span *ngSwitchDefault>{{triggerValue}}</span>
<span *ngSwitchDefault>{{triggerValue || '\u00A0'}}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the escape sequence instead of a space ' '?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a reason for doing it a bit above in the select as well, but I don't remember exactly what it was. I think it's because the browser would still collapse the regular whitespace string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's the js equivalent of &nbsp;

@jelbourn jelbourn merged commit 45b949a into angular:master Jul 12, 2018
victoriaaa234 pushed a commit that referenced this pull request Jul 25, 2018
Fixes selecting an option that has a blank string as a label throwing off the alignment of `mat-select`.

Fixes #11969.
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mat Select Spacing increases on blank value select

4 participants