Skip to content

Commit

Permalink
fix(cdk/listbox): error with multiple preselected values (#25621)
Browse files Browse the repository at this point in the history
The CDK listbox had a subscription to its model changes in the constructor which fires immediately due to the `startsWith` and which was attempting to sort the selected values when in multiple selection mode. The problem is that the options aren't available until `ngAfterContentInit` which was causing an error when we tried to do the sorting.

These changes move the change event subscription to `ngAfterContentInit` so that options are guaranteed to be defined when it fires.

Fixes #25611.
  • Loading branch information
crisbeto committed Sep 11, 2022
1 parent 7021954 commit 1b0265c
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 119 deletions.

0 comments on commit 1b0265c

Please sign in to comment.