Skip to content

md-select affects flexbox (and also alignments with width=100% or table/table-cell) #4289

Closed
@Mario-Eis

Description

@Mario-Eis

Bug, feature request, or proposal:

Bug

What is the expected behavior?

md-select should align correct in a flexbox

What is the current behavior?

The placeholder of the md-select gets a width assigned and is then scaled down. This assigned width seems to large. It destroys the alignment of the outside flexbox.
2017-04-26 19_34_53-plunker
(here the margin on the right side seems to be ignored. But its the md-select placeholder that forces the button to the right)

Further the assigned size prevents the md-select from resizing (Smaller. Larger works because the md-select just can't get smaller as the assigned width of the placeholder)
2017-04-26 19_52_30-plunker

What are the steps to reproduce?

e.g. a md-select next to a button in a flexbox
See this Plunkr: http://plnkr.co/edit/tThcD4?p=preview

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

Possibility to (dynamicaly) align a md-select.

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

Angular 4.0.1, Material beta3, Chrome

Is there anything else we should know?

This seems to fix the issue (but I don't know of any side effects)

span.mat-select-placeholder.mat-floating-placeholder {
  width: auto !important;
}

Maybe there is a relation to #3073

Update: The issue doesn't only affect flexboxes but also alignments with width=100% or table/table-cell

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaround

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions