angular / angular/components

mat-select - Allow mat-option selected property to be settable

Open
#7,246 23 comments 22 reactions 0 assignees View on GitHub
area: material/select feature needs: discussion P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:
Feature request

#### What is the expected behavior?
To be able to set the mat-option selected property

#### What is the current behavior?
Currently the mat-option selected property is readonly and you have to programatically select options.

#### What is the use-case or motivation for changing an existing behavior?
Being able to bind to the selected property would be a cleaner implementation for a user versus having to do it manually, especially in cases where using cascading mat-select with multiple=true (harder to manage)

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.4.3
Material 2.0.0-beta.11
Windows 10
TypeScript - 2.5.2
All browsers

Contributor guide

Open the contributing guide

Research direction

Start by reading the mat-select and mat-option implementation to understand how the readonly selected property is currently managed. Confirm the intended binding behavior for mat-option, including cascading mat-select cases with multiple=true. Done means selected can be set or bound as requested without breaking existing selection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.