angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.22k stars 6.69k forks source link

After selecting an option on md-select it does not adjust width while resizing window #2711

Open jfletcher2 opened 7 years ago

jfletcher2 commented 7 years ago

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Once the user selects a value on md-select and the browser window is resized the md-select element should adjust its width accordingly. md-input works fine.

What is the current behavior?

The md-select width is not adjusted correctly when the browser window is re-sized. Full Size window: full-size

Resized window: resize_issue

What are the steps to reproduce?

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

  1. If we try resizing the preview window without choosing any options on both "Select Option 1" and "Select Option 2", it should work fine.
  2. Choose an option for "Select Option 1" and "Select Option 2" and then try to resize. The select element does not adjust its width automatically like it did when none of the options were selected.

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

The field alignment for md-select is thrown off when the user tries to resize the page.

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

Angular Material (SHA 899f190) Browser: Chrome

shlomiassaf commented 6 years ago

@jelbourn I created a quick PR for that, see #6684

I wrote an explanation on why and how

SchnWalter commented 6 years ago

At a quick glance, this seem to be related to #5298