md-select : selected value doesn't change after md-option text is changed using fxHide
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Selected value should change according to md-option values. Whether md-option is updated selected value should change
What is the current behavior?
Selected value doesn't change the value after fxHide is called and md-option values are changed
What are the steps to reproduce?
- Open a browser
- Change the size of the browser to (lt-md)
- md-option should hide some information in responsive (lt-md)
https://plnkr.co/edit/L5XWZW7ew4gym47nPHaZ?p=preview
What is the use-case or motivation for changing an existing behavior?
For responsive design, I need to hide some elements in mdoptions.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular": "^4.3.3", "@angular/flex-layout": "2.0.0-beta.8", "@angular/material": "^2.0.0-beta.8",
Is there anything else we should know?
For responsive design I hide an element (food.value) in md-option, however the selected value doesn't refresh the change in md-option
The viewValue of the trigger is calculated from this
// option.ts
get viewValue(): string {
return (this._getHostElement().textContent || '').trim();
}
And since fxHide doesn't actually remove the text from the DOM, it is still read as a part of textContent. To customize the trigger display value, https://github.com/angular/material2/pull/3341 will be merged soon.
the problem is solved using md-select-trigger.
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.