Skip to content

[toast] Keep timers paused during overlapping interactions - #5809

Merged
atomiks merged 3 commits into
mui:masterfrom
lyzno1:codex/toast-pause-interactions
Oct 2, 2026
Merged

atomiks merged 3 commits into
mui:masterfrom
lyzno1:codex/toast-pause-interactions

Conversation

@lyzno1

@lyzno1 lyzno1 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Keep timers paused when the pointer leaves a focused toast or keyboard focus leaves a hovered toast. Resume the remaining timeout after both interactions end.

Reproduction

Create a toast with an action button and a nonzero timeout. Use F6 to enter the toast viewport, focus the action button with the keyboard, and hover the toast with the pointer. Then try each case separately:

  1. Move the pointer outside the toast viewport while keeping keyboard focus on the action button.
  2. Move keyboard focus outside the toast viewport while keeping the pointer over the toast.

Before this fix, either case resumes the timer and allows the toast to dismiss while the other interaction is still active. The timer should stay paused until both hover and keyboard focus have left the viewport, then continue with the remaining timeout.

The regression tests cover both interaction orders and verify that the remaining timeout resumes after both interactions end.

Copilot AI lite review requested due to automatic review settings September 26, 2026 06:34

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Updates toast timers so overlapping hover and focus interactions keep them paused until both end.

Changes:

  • Coordinate timer resumption across hover, focus, and window-blur states.
  • Add regression tests for overlapping interactions.
File Description
packages/​react/​src/​toast/​viewport/​ToastViewport.tsx Coordinates timer resumption across interaction states.
packages/​react/​src/​toast/​viewport/​ToastViewport.test.tsx Tests overlapping hover and focus behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pkg-pr-new

pkg-pr-new Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@5809
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5809
    

commit: bd1b6b4

@code-infra-dashboard

code-infra-dashboard Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+1B(0.00%) ▼-5B(0.00%)

Details of bundle changes

Performance

Total duration: 391.76 ms -4.97 ms(-1.3%) | Renders: 76 (+0) | Paint: 704.96 ms -18.86 ms(-2.6%)

No significant changes — details


Check out the code infra dashboard for more information about this PR.

@lyzno1 lyzno1 changed the title fix(toast): keep timers paused during overlapping interactions [toast] Keep timers paused during overlapping interactions Sep 26, 2026
@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit bd1b6b4
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6abf9836db199700086456d0
😎 Deploy Preview https://deploy-preview-5809--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@zannager zannager added the component: toast Changes related to the toast component. label Sep 29, 2026

@atomiks atomiks 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.

Thanks for the fix

@atomiks
atomiks merged commit 46f7463 into mui:master Oct 2, 2026
24 checks passed
@atomiks atomiks added the type: bug It doesn't behave as expected. label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: toast Changes related to the toast component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants