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.

md-select: selected item label is shown twice when md-option list changes #9442

@oemmes

Description

@oemmes

Actual Behavior:

  • What is the issue? * If an item is selected and the option list (<md-option ng-repeat="...">) changes the select box contains the label of the selected item twice (as if it was selected multiple times): "value, value".
    When later on a digest cycle runs for the scope of the md-select (e.g. by opening the select box again) the label is updated correctly.
  • What is the expected behavior? The selected value should only be shown once as label.

CodePen (or steps to reproduce the issue): *

While checking if it's related to changes in our application code (which it is not) I already found out that the syncLabelText() method is called multiple times. The first time is okay, but the next calls create the wrong label because the <md-option> elements are contained twice in the <md-select-menu> and both elements with the current value are marked as "selected". Looks like there's a mix of old and new <md-option> elements in the DOM.

Angular Versions: *

  • Angular Version: 1.4.12, 1.5.5
  • Angular Material Version: 1.1.0 stable (reproducable since 1.1.0-rc2)

Additional Information:

  • Browser Type: * any
  • Browser Version: * any
  • OS: * any
  • Stack Traces:

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

Metadata

Metadata

Assignees

Labels

P1: urgentUrgent issues that should be addressed in the next minor or patch release.has: Pull RequestA PR has been created to address this issueresolution: fixedtype: bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions