Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

select: label does not update on option change #3909

Closed
no-more opened this issue Jul 27, 2015 · 6 comments
Closed

select: label does not update on option change #3909

no-more opened this issue Jul 27, 2015 · 6 comments

Comments

@no-more
Copy link

no-more commented Jul 27, 2015

Hi,

I have an issue with the new version of md-select. If I change the label of the current selected option (stored in a array), the change is not reflected on the already selected label. I have to open the select, in the select list the option label is correct, I can then just close the select (no need to change my selection) and I'll see the new label.

I suspect this is because the change does not trigger the label generation as it might only be done when opening the select list. But I really need this for dynamics selects.

Thanks.

@ThomasBurleson ThomasBurleson added the needs: review This PR is waiting on review from the team label Jul 31, 2015
@ThomasBurleson ThomasBurleson modified the milestone: REVISIT Jul 31, 2015
@rschmukler
Copy link
Contributor

@no-more can you please submit a codepen/demo of the issue that you're seeing?

@rschmukler rschmukler modified the milestones: 1.0-beta1, REVISIT Aug 3, 2015
@rschmukler rschmukler added the needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue label Aug 3, 2015
@no-more
Copy link
Author

no-more commented Aug 4, 2015

Hi,

You can try on : http://codepen.io/anon/pen/oXJRqP

If you select a label then change the corresponding the selected label. The selected one does not update until you open the select dialog.

Thanks.

@naomiblack naomiblack modified the milestones: 1.0-beta1, 0.12.0 Aug 14, 2015
@bjansen
Copy link

bjansen commented Sep 6, 2015

I have the same kind of problem: I need to show a part of the label based on a condition, like this:

<md-option>Sample text <span ng-show="value > 0">({{value}})</span></md-option>

If I initialize my scope with value = 0, the condition is not applied and the resulting label is Sample text (0). When I click on the select, the options are shown correctly (i.e. it hides (0)), but as soon as I close the menu it shows the wrong value again.
Changing value results in the select box not being updated unless I click on it. Here's a sample app that shows my problem: http://codepen.io/anon/pen/jbEogB

@ivan7237d
Copy link

+1

Another example: http://codepen.io/anon/pen/BojGYa?editors=101

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc1, 1.0-rc2, 1.0-rc3 Oct 27, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc3, 1.0-rc4 Nov 7, 2015
@ThomasBurleson ThomasBurleson removed this from the 1.0-rc4 milestone Nov 16, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc5, 1.0-rc4 Nov 16, 2015
@vapits
Copy link

vapits commented Feb 29, 2016

This issue is actual still there in the latest stable 1.0.5 version.

@elir-copyleaks
Copy link

One possible solution is to display the select inside a directive setting the directive label from it's scope. Then ng-if'ing the directive with a different input for the label.

@Splaktar Splaktar changed the title md-select label does not update on option change select: label does not update on option change Sep 6, 2018
@Splaktar Splaktar added resolution: fixed and removed needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue needs: review This PR is waiting on review from the team labels Sep 6, 2018
@angular angular locked as resolved and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants