Skip to content

fix(Drawer): cover existing service drawers with dialog backdrops - #8865

Merged
ArgoZhang merged 3 commits into
mainfrom
ArgoZhang/fix-dialog
Nov 26, 2026
Merged

ArgoZhang merged 3 commits into
mainfrom
ArgoZhang/fix-dialog

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Link issues

fixes #8864

Summary By Copilot

  • Keep service drawers attached to the modal host active when they were created, rather than following subsequently opened dialogs.
  • Preserve the existing follow-active-modal behavior for Message and Toast and retain fullscreen overlay support.
  • Add a localized /drawer example that opens a dialog from a service drawer.
  • Bump BootstrapBlazor from 11.1.2-beta06 to 11.1.2-beta07.

Regression?

  • Yes
  • No

The exact version introducing this behavior was not confirmed.

Risk

  • High
  • Medium
  • Low

The shared overlay helper gains an opt-out from following newer modal hosts. Only service drawers use this option; Message and Toast retain the default behavior.

Verification

  • Manual (required)

  • Automated

  • Browser verification on /drawer: opening a dialog from the service drawer darkens the drawer; closing the dialog restores drawer interaction. Also checked fullscreen and opening a drawer while a dialog is already open.

  • dotnet build src\BootstrapBlazor --no-restore --nologo -v quiet — passed, 0 warnings and 0 errors during implementation.

  • dotnet build src\BootstrapBlazor.Server --configuration Release --no-restore --nologo -v quiet — passed against the final committed branch, 0 warnings and 0 errors.

  • dotnet build src\BootstrapBlazor.Server --no-restore --nologo -v quiet — failed on the publication rerun because an already running BootstrapBlazor.Server process locked the Debug output. The running process was left untouched; Release validation passed.

  • git diff --check d83a35e39bd713a1cc6fc2799b0242538dfa39d2...HEAD — passed.

  • No unit tests or JavaScript tests were added or run, following repository policy. Automated verification above means build and whitespace checks.

The right-hand drawer is dimmed beneath the centered dialog:

Dialog backdrop covering the service drawer

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Only the package version changes from 11.1.2-beta06 to 11.1.2-beta07; no package was produced.

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

The branch includes the latest fetched main commit, d83a35e39bd713a1cc6fc2799b0242538dfa39d2.

Summary by Sourcery

Ensure service drawers remain correctly covered when dialogs open while preserving existing overlay behavior for other components.

New Features:

  • Add a localized drawer example demonstrating dialog interaction from a service drawer.

Bug Fixes:

  • Keep service drawer backdrops associated with the modal host active when the drawer opened, preventing newer dialogs from obscuring or displacing them.

Enhancements:

  • Preserve active-modal overlay behavior for Message and Toast while supporting fullscreen overlays and service drawer coverage.

Build:

  • Bump the BootstrapBlazor package version from 11.1.2-beta06 to 11.1.2-beta07.

@sourcery-ai

sourcery-ai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Implementation

Change service drawer overlays to stay with the modal host active when they are created, while retaining active-modal following by default for other overlays.

  • src/BootstrapBlazor/Components/Drawer/Drawer.razor.js L89
  • src/BootstrapBlazor/wwwroot/modules/fullscreen.js L103, L116-119, L149-154

UI

Add a localized drawer example that opens a dialog from the service drawer to demonstrate the corrected backdrop behavior.

  • src/BootstrapBlazor.Server/Components/Samples/Drawers.razor L69-85
  • src/BootstrapBlazor.Server/Components/Samples/Drawers.razor.cs L16-18, L76-90
  • src/BootstrapBlazor.Server/Locales/en-US.json L2256-2263
  • src/BootstrapBlazor.Server/Locales/zh-CN.json L2256-2263

Configuration

Bump the BootstrapBlazor package version to beta07 alongside the overlay fix.

  • src/BootstrapBlazor/BootstrapBlazor.csproj L4

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot added the bug Something isn't working label Nov 26, 2026
@bb-auto bb-auto Bot added this to the v11.1.0 milestone Nov 26, 2026

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved by bb-auto

@sourcery-ai

sourcery-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit 3692c94

#8864 bug(Drawer): dialog backdrop does not cover an existing service drawer · 2 of 2 met

# Requirement Status Notes
1 The dialog backdrop covers an existing service drawer, and closing the dialog leaves the drawer available for interaction. ✅ Met Service drawers opt out of following newly opened modal hosts; when the dialog closes, the drawer is restored to its placeholder.
2 Add a runnable /drawer example that opens a dialog from a service drawer. ✅ Met The new DrawerDialog example opens a service drawer with a button that calls DialogService.Show.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/BootstrapBlazor/wwwroot/modules/fullscreen.js" line_range="119-122" />
<code_context>
+export function attachOverlay(el, { followModal = true } = {}) {
     const placeholder = document.createComment('fullscreen-overlay')
     el.before(placeholder)
+    let ownerHost = followModal ? null : getActiveModalHost()

     const move = parent => {
</code_context>
<issue_to_address>
**Open drawers leave their modal**

When a drawer stays open while its modal closes, reopens, or another modal opens, `ownerHost` remains null or is cleared, and `followModal: false` makes `update` select no active host. The drawer moves to its placeholder instead of sharing the active modal’s stacking and interaction behavior, leaving it covered or inaccessible.

For a non-following drawer, select the active modal host when `ownerHost` is null or no longer valid, and retain that host as the drawer’s owner.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: src/BootstrapBlazor/wwwroot/modules/fullscreen.js:122


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +119 to 122
let ownerHost = followModal ? null : getActiveModalHost()

const move = parent => {
const focused = document.activeElement

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Open drawers leave their modal

When a drawer stays open while its modal closes, reopens, or another modal opens, ownerHost remains null or is cleared, and followModal: false makes update select no active host. The drawer moves to its placeholder instead of sharing the active modal’s stacking and interaction behavior, leaving it covered or inaccessible.

For a non-following drawer, select the active modal host when ownerHost is null or no longer valid, and retain that host as the drawer’s owner.

Prompt for AI agents
In `src/BootstrapBlazor/wwwroot/modules/fullscreen.js` at lines 119-153:

**Open drawers leave their modal**

When a drawer stays open while its modal closes, reopens, or another modal opens, `ownerHost` remains null or is cleared, and `followModal: false` makes `update` select no active host. The drawer moves to its placeholder instead of sharing the active modal’s stacking and interaction behavior, leaving it covered or inaccessible.

For a non-following drawer, select the active modal host when `ownerHost` is null or no longer valid, and retain that host as the drawer’s owner.

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d83a35e) to head (3692c94).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8865   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          664       664           
  Lines        30484     30484           
=========================================
  Hits         30484     30484           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ArgoZhang
ArgoZhang merged commit 5eeb961 into main Nov 26, 2026
7 checks passed
@ArgoZhang
ArgoZhang deleted the ArgoZhang/fix-dialog branch November 26, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Drawer): dialog backdrop does not cover an existing service drawer

1 participant