-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix: prevent nested expansion panels from registering to the same accordion #11342
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
class NestedItems { | ||
@ViewChild('outerItem') outerItem: CdkAccordionItem; | ||
@ViewChild('innerItem') innerItem: CdkAccordionItem; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a new line at the end of the file.
providers: [ | ||
// Provide CdkAccordion as undefined to prevent nested accordion items from registering | ||
// to the same accordion. | ||
{provide: CdkAccordion, useValue: undefined}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that you can do this. I had to do something similar on the menu, but I ended up adding a provider and having the items register themselves with it.
@josephperrott seems like there are some lint warnings. |
4c0e1cf
to
e584569
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
e584569
to
ef6fa95
Compare
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. |
Fixes #11242