-
-
Notifications
You must be signed in to change notification settings - Fork 362
fix(Dialog): Fix scrolling issue in nested/multiple dialogs #6786
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
fix(Dialog): Fix scrolling issue in nested/multiple dialogs #6786
Conversation
|
Thanks for your PR, @Copilot. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Co-authored-by: ArgoZhang <[email protected]>
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.
Pull Request Overview
This PR fixes a scrolling issue in nested/multiple dialogs where the second and subsequent dialogs could not scroll properly when their content exceeded the viewport height. The fix enhances the CSS for multiple dialogs to maintain proper modal behavior while preserving the stacking functionality.
- Adds flexbox layout to center dialogs properly
- Controls content height with viewport constraints and enables scrolling in the modal body
- Creates a comprehensive test page to verify the fix works at any nesting depth
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Modal/Modal.razor.scss | Enhanced CSS rules for .modal-multiple .modal-dialog to fix scrolling behavior while maintaining proper centering and spacing |
| src/BootstrapBlazor.Server/Components/Pages/TestScrollDialog.razor | Added comprehensive test page demonstrating nested dialog scrolling functionality with three levels of dialogs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6786 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 739 739
Lines 31739 31744 +5
Branches 4467 4468 +1
=========================================
+ Hits 31739 31744 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Problem
When multiple dialogs were stacked (nested dialogs), the second and subsequent dialogs could not scroll properly when their content exceeded the viewport height. Users could scroll the first dialog normally, but any additional dialogs opened on top would have their scrolling functionality broken.
Root Cause
The CSS rule
.modal-multiple .modal-dialogusedposition: fixedwithinset: 0, which made nested dialogs fill the entire viewport and overrode Bootstrap's normal modal scrolling behavior. This prevented the standard Bootstrap modal scrolling mechanism from functioning correctly.Solution
Enhanced the CSS for multiple dialogs to maintain proper modal behavior while preserving the stacking functionality:
The fix:
Testing
Before/After
Before: Nested dialogs filled entire viewport, no scrolling possible
After: Nested dialogs properly centered and scrollable, maintaining Bootstrap modal behavior
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.