Skip to content

[MdListOption] selected value not checked when accessing MdSelectionList.selectedOptions.selected #7183

Closed

Description

@glampr

Bug, feature request, or proposal:

Bug

What is the expected behavior?

If a MdListOption's has its @Input('selected') value set to true upon initialization, it should be included in the selectedOptions.selected attribute of its enclosing MdSelectionList.

What is the current behavior?

The MdListOption's initial @Input('selected') value is not respected when accessing the selectedOptions.selected attribute of its enclosing MdSelectionList.
An option that has its initial selected value to true is not included in the selectedOptions.selected but when it is subsequently click and thus gets unselected, then it is included in the selectedOptions.selected attribute of its MdSelectionList.

What are the steps to reproduce?

http://plnkr.co/edit/CXc5dKsoNWzU89s3endl?p=preview

Click the 'Show selected' button.
Then uncheck the selected option ('two') and click again on 'Show selected'.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 4.3.0
Material: 2.0.0-beta.10
Typescript: 2.3.2

Activity

  1. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  2. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions