fix(theming): fix theming bootstrap dropdown#3963
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses an interaction issue in the Bootstrap theming sample where ngbAccordion/collapse DOM behavior interferes with overlay-based components (e.g., dropdowns / dialogs). It removes the ng-bootstrap accordion usage and replaces it with a lightweight local toggle approach.
Changes:
- Removed
ngbAccordion/collapse imports from the sample component and replaced accordion state with local booleans. - Updated the template to render the “accordion” content conditionally via
@ifblocks rather than ng-bootstrap accordion directives.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/app/theming/bootstrap/bootstrap-sample.component.ts | Removes ng-bootstrap accordion-related imports and introduces local open/close state for the accordion items. |
| src/app/theming/bootstrap/bootstrap-sample.component.html | Replaces ngbAccordion markup with Bootstrap accordion classes and local click-to-toggle rendering via @if. |
Comments suppressed due to low confidence (3)
src/app/theming/bootstrap/bootstrap-sample.component.html:238
ml-1is a Bootstrap 4 utility; this repo depends on Bootstrap 5.3.x, where the equivalent isms-1. Usingml-1won’t apply spacing with Bootstrap 5.
This issue also appears on line 264 of the same file.
<h5 class="m-0">
Balance: <span class="ml-1 primary">$ 3543.51</span>
</h5>
src/app/theming/bootstrap/bootstrap-sample.component.html:262
- The accordion toggle button is missing the Bootstrap-recommended a11y attributes. Consider binding
aria-expandedto the open state and wiringaria-controlsto anidon the corresponding panel so screen readers can understand the expanded/collapsed relationship.
<button class="accordion-button collapsed" [class.collapsed]="!mastercardOpen" type="button" (click)="mastercardOpen = !mastercardOpen">
<div class="d-flex align-items-center justify-content-between">
src/app/theming/bootstrap/bootstrap-sample.component.html:267
ml-1is a Bootstrap 4 utility; this repo depends on Bootstrap 5.3.x, where the equivalent isms-1. Usingml-1won’t apply spacing with Bootstrap 5.
<h5 class="m-0">
Balance:
<span class="ml-1 primary">$ 12,354.32</span>
</h5>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <button class="accordion-button collapsed" [class.collapsed]="!visaOpen" type="button" (click)="visaOpen = !visaOpen"> | ||
| <div class="d-flex align-items-center justify-content-between"> |
| @if (visaOpen) { | ||
| <div class="accordion-collapse accordion-body"> | ||
| <igx-list> | ||
| @for (contact of contacts; track contact) { |
fb48cb9 to
753a35d
Compare
There was a problem hiding this comment.
Removing the ngbAccordion directives and using custom implementation directly doesn't sound like a fix to me. Either this should be logged as a product bug or if there's a way to make it work in conjunction with the Bootstrap Theming, which is the point of the sample anyway.
Closes #3810
The conflict seems to come from ngbAccordion/ngbAccordionCollapse interaction with overlay-based components (igx-dialog, dropdowns).
Replacing the accordion with a lightweight local toggle implementation removes the DOM manipulation/collapse behavior that was interfering with dropdown rendering and interaction