Commit eb5f79b
committed
fix(cdk/listbox): error with multiple preselected values (#25621)
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.
(cherry picked from commit 1b0265c)1 parent f0556a9 commit eb5f79b
File tree
3 files changed
+143
-119
lines changed- src/cdk/listbox
- tools/public_api_guard/cdk
3 files changed
+143
-119
lines changed
0 commit comments