Skip to content

unexpected behavior with mat-option select() #9314

Closed
@schmeic

Description

@schmeic

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When manually calling select()/deselect() on a MatOption, I would expect the following to happen:

  1. The MatSelect label changes
  2. The MatSelect selectionChange callback is called
  3. The MatSelect formControl value changes

What is the current behavior?

Currently, only the option checkbox changes in the dom. The 3 things listed above do not happen.

What are the steps to reproduce?

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

What is the use-case or motivation for changing an existing behavior?

It would be nice to be able to programmatically select/deselect options - for example, buttons to "Select All" or "Select None".

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

Tested with Angular Material version: 5.0.4-303e004

Is there anything else we should know?

I would be willing to try and create a pull request, but wanted to first confirm that this is actually considered a bug.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions