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

select: changing ng-model after render with md-virtual-repeat does not display selected value #11842

Open
sunnyjhon2020 opened this issue Jan 13, 2020 · 1 comment
Assignees
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P3: important Important issues that really should be fixed when possible. type: bug
Milestone

Comments

@sunnyjhon2020
Copy link

sunnyjhon2020 commented Jan 13, 2020

it is a normal md-select with options and instead of ng-repeat i have used md-virtual-repeat but the ng-model is not working!

See the codepen for more details - https://codepen.io/lakshmi_suhas/pen/abzKJmq

when trying to select any option it it binding, but assume data is getting from backend and want to bind the default option (see the $timeout call in pen) it is not working at first but when the md-select is opened / clicked the selectedOption is binding.

Please tell me what's wrong in the code or it is material bug.

@sunnyjhon2020 sunnyjhon2020 changed the title md-select > ng-model is not working with md-virtual-repeat-container (assume data getting from backend) md-select > ng-model is not working with md-virtual-repeat-container (assume data coming from backend) Jan 14, 2020
@Splaktar
Copy link
Member

Splaktar commented Feb 1, 2020

I updated the CodePen to 1.1.21 and ran into the options not displaying at all due to #10868.

I see that you are using AngularJS Material 1.0.9 since that is the last version to support md-virtual-repeat with md-select due to that above issue.

Your CodePen gives me the following exception on load:

ReferenceError: selectedOption is not defined
    at b.$scope.checkForSelected (pen.js:61)

I fixed it in this CodePen, but it only resolves the exception and not the issue with the select showing the selected value on page load.

@Splaktar Splaktar changed the title md-select > ng-model is not working with md-virtual-repeat-container (assume data coming from backend) select: changing ng-model after render with md-virtual-repeat does not display selected value Feb 1, 2020
@Splaktar Splaktar self-assigned this Feb 1, 2020
@Splaktar Splaktar added the P3: important Important issues that really should be fixed when possible. label Feb 1, 2020
@Splaktar Splaktar added this to the 1.1.23 milestone Feb 1, 2020
@Splaktar Splaktar added type: bug needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community labels Feb 1, 2020
@Splaktar Splaktar modified the milestones: 1.1.23, 1.2.1 May 6, 2020
@Splaktar Splaktar modified the milestones: 1.2.1, 1.2.2 Sep 14, 2020
@Splaktar Splaktar modified the milestones: 1.2.2, - Backlog Oct 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P3: important Important issues that really should be fixed when possible. type: bug
Projects
None yet
Development

No branches or pull requests

2 participants