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

bug(select) Extra space at the end of placeholder span #6923

Closed
dima74 opened this issue Sep 7, 2017 · 2 comments · Fixed by #6955
Closed

bug(select) Extra space at the end of placeholder span #6923

dima74 opened this issue Sep 7, 2017 · 2 comments · Fixed by #6955
Assignees

Comments

@dima74
Copy link

dima74 commented Sep 7, 2017

Bug:

I have the following code:

<md-select placeholder="hello" [value]="1">
  <md-option [value]="1">one</md-option>
  <md-option [value]="2">two</md-option>
</md-select>

The most important part is placeholder="hello". Angular Material will create separate span for placeholder and put string hello inside it.

What is the expected behavior?

The resulting span should look like <span>hello</span>, without extra space at the end.

What is the current behavior?

The resulting span looks like <span>hello </span>, with extra space at the end:

image

What are the steps to reproduce?

Plunker: http://plnkr.co/edit/0egSObwCtsCqxVMW6WRH?p=preview

What is the use-case or motivation for changing an existing behavior?

If placeholder consists of two words, then this extra space may cause unnecessary word wrap.

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

At least Arch Linux, Angular 4.0.0, Material 2.0.0-beta.10, TypeScript 2.3.3, Chrome 59.

Is there anything else we should know?

I think you can fix this issue by remove spaces around {{ placeholder }} in > {{ placeholder }} </span> (this line).

@donroyco
Copy link
Contributor

donroyco commented Sep 8, 2017

I thought this was done to keep some space between the placeholder and the asterisk if a field is marked as required. It's not the best solution, the asterisk should have some margin-left and the placeholder should have no extra space.

required

@crisbeto crisbeto added the has pr label Sep 9, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 9, 2017
Fixes some extra whitespace being added around the placeholder.

Fixes angular#6923.
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 11, 2017
Fixes some extra whitespace being added around the placeholder.

Fixes angular#6923.
mmalerba pushed a commit that referenced this issue Sep 12, 2017
Fixes some extra whitespace being added around the placeholder.

Fixes #6923.
josephperrott pushed a commit to josephperrott/components that referenced this issue Sep 15, 2017
Fixes some extra whitespace being added around the placeholder.

Fixes angular#6923.
@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 7, 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

Successfully merging a pull request may close this issue.

3 participants