New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(Overlay / Listbox): Error thrown when a listbox with cdkListboxMultiple is rendered inside an overlay #25611
Labels
Comments
crisbeto
added
P2
The issue is important to a large percentage of users, with a workaround
has pr
area: cdk/listbox
and removed
needs triage
This issue needs to be triaged by the team
labels
Sep 10, 2022
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Sep 10, 2022
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 angular#25611.
crisbeto
added a commit
that referenced
this issue
Sep 11, 2022
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.
crisbeto
added a commit
that referenced
this issue
Sep 11, 2022
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)
forsti0506
pushed a commit
to forsti0506/components
that referenced
this issue
Sep 16, 2022
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 angular#25611.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When a listbox component is used inside an overlay, an error is thrown if the listbox contains multiple selected options
Reproduction
https://stackblitz.com/edit/angular-ivy-cgbcrq?file=src/app/dropdown.component.ts
Steps to reproduce:
Expected Behavior
The list should render without error
Actual Behavior
The following error is displayed in the console :
Environment
The text was updated successfully, but these errors were encountered: