Skip to content
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

md-select : selected value doesn't change after md-option text is changed using fxHide #6353

Closed
dhuallanca opened this issue Aug 8, 2017 · 3 comments

Comments

@dhuallanca
Copy link

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?

  1. Open a browser
  2. Change the size of the browser to (lt-md)
  3. 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

@willshowell
Copy link
Contributor

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, #3341 will be merged soon.

@dhuallanca
Copy link
Author

the problem is solved using md-select-trigger.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants