Skip to content

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

@dima74

Description

@dima74

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions