-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Select not set to ngModel initial value #4854
Comments
That's weird, because if you set selectedSortBy='0' (string) it works in any of two ways:
or
But both of them fail with numbers. |
Looks like the offending line is here: // _selectValue()
optionsArray.find(option => option.value && option.value === value); A value of |
Fixes not being able to set falsy values progammatically in `md-select`. Fixes angular#4854.
Any idea when it will be merged? |
Fixes not being able to set falsy values progammatically in `md-select`. Fixes angular#4854.
Not sure if it will be usefull, but here is a pluker: https://plnkr.co/edit/UURJWRfiglafS8KkOjRt?p=preview |
Fixes not being able to set falsy values progammatically in `md-select`. Fixes #4854.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
When setting the ngModel variable in code behind onInit the selected display value is not showing.
This works in beta 5 but not anymore in beta 6
What is the expected behavior?
The select should show the display string of the ngModel value
What is the current behavior?
It does not show anything
What are the steps to reproduce?
and in component file onInit setting
selectedSortBy= 0;
does not display Latest
What is the use-case or motivation for changing an existing behavior?
Select should show the databound value
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material beta.6 latest angular
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: