fix(theming): fix theming bootstrap dropdown#3963
Open
Hristo313 wants to merge 1 commit into
Open
Conversation
Contributor
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.
Comment on lines
+233
to
+234
| <button class="accordion-button collapsed" [class.collapsed]="!visaOpen" type="button" (click)="visaOpen = !visaOpen"> | ||
| <div class="d-flex align-items-center justify-content-between"> |
Comment on lines
+242
to
+245
| @if (visaOpen) { | ||
| <div class="accordion-collapse accordion-body"> | ||
| <igx-list> | ||
| @for (contact of contacts; track contact) { |
fb48cb9 to
753a35d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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