Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was 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

Description

@sunnyjhon2020

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.

Activity

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)[/+] on Jan 14, 2020
Splaktar

Splaktar commented on Feb 1, 2020

@Splaktar
Contributor

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.

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[/+] on Feb 1, 2020
self-assigned this
on Feb 1, 2020
added
P3: importantImportant issues that really should be fixed when possible.
on Feb 1, 2020
added this to the 1.1.23 milestone on Feb 1, 2020
added
needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
on Feb 1, 2020
modified the milestones: 1.1.23, 1.2.1 on May 6, 2020
modified the milestones: 1.2.1, 1.2.2 on Sep 14, 2020
modified the milestones: 1.2.2, - Backlog on Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3: importantImportant issues that really should be fixed when possible.needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or communitytype: bug

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Splaktar@sunnyjhon2020

      Issue actions

        select: changing ng-model after render with md-virtual-repeat does not display selected value · Issue #11842 · angular/material