Skip to content

fix: keep mobile sidebar open for portaled focus#623

Merged
mattrothenberg merged 1 commit into
cloudflare:mainfrom
hkfoster:fix/sidebar-mobile-portal-focus
Jul 9, 2026
Merged

fix: keep mobile sidebar open for portaled focus#623
mattrothenberg merged 1 commit into
cloudflare:mainfrom
hkfoster:fix/sidebar-mobile-portal-focus

Conversation

@hkfoster

@hkfoster hkfoster commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #604

Summary

Fixes the mobile Sidebar closing unexpectedly when focus moves outside the sidebar into portaled interactive content, such as dropdown menus or popovers rendered from inside the sidebar.

The mobile Sidebar now closes on explicit dismissal actions only:

  • Escape key
  • Backdrop click

Changes

  • Removed the mobile Sidebar focusout listener that closed the drawer when focus moved outside the sidebar DOM subtree.
  • Updated the mobile Sidebar regression test to verify the drawer stays open when focus moves outside, matching portaled nested interactive behavior.
  • Added a patch changeset for @cloudflare/kumo.

Validation

  • pnpm --filter @cloudflare/kumo test:unit src/components/sidebar/sidebar.test.tsx

  • pnpm --filter @cloudflare/kumo typecheck

  • pnpm --filter @cloudflare/kumo lint

  • Reviews

    • bonk has reviewed the change
    • automated review not possible because: targeted behavioral fix for mobile focus handling
  • Tests

    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:

@pkg-pr-new

pkg-pr-new Bot commented Jul 9, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@cloudflare/kumo@623

commit: fa53c79

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Docs Preview

View docs preview

Commit: fa53c79

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
Visual Regression Report — 2 changed, 0 unchanged

2 screenshot(s) with visual changes:

Dialog (Open)

23,408,620 px (93.43%) changed

Before After Diff
Before After Diff

Select (Open)

23,586,636 px (93.42%) changed

Before After Diff
Before After Diff

Generated by Kumo Visual Regression

@mattrothenberg mattrothenberg merged commit 0e440d4 into cloudflare:main Jul 9, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Sidebar: Mobile drawer closes unexpectedly on mobile when focus moves to nested interactive elements

2 participants