components icon indicating copy to clipboard operation
components copied to clipboard

MdSelect does not bind when the model value is null or 0.

Open Nathan-Ryan opened this issue 9 years ago • 4 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The appropriate MdOption is selected, even if the model is null or 0.

What is the current behavior?

The control does not show the option as being selected, even though the model value has a respective MdOption.

What are the steps to reproduce?

Define an MdSelect with two MdOptions, one should have a [value]="0". (I'm using an enum to define the option values) Within the ngOnInit event, instantiate the FormGroup and set the model value to 0.

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

To have a working form.

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

Angular: 4.2.2 Material: 2.0.0-beta.6 OS: Windows 10 TS: 2.3.4 Browser: Chrome 58.0.3029.110

Is there anything else we should know?

I noticed inconsistencies with the MdSelect binding before, now it fails all the time. There are far too many issues (styling, awkward and minimal keyboard control, no error message support) for such a simple control. Can we please just have the native select supported with MdInputContainer?

Nathan-Ryan avatar Jun 16 '17 01:06 Nathan-Ryan

Dupe of #5080.

It'll be solved next beta release.

julianobrasil avatar Jun 16 '17 02:06 julianobrasil

@julianobrasil Thanks for the heads up. Do we know when the next beta will be released?

Nathan-Ryan avatar Jun 16 '17 02:06 Nathan-Ryan

I have no idea. But you can try the latest build on master. This is already corrected there.

julianobrasil avatar Jun 16 '17 02:06 julianobrasil

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.