Skip to content

[RFC] Toast: let Escape dismiss the focused toast #13805

Backlog

Description

@camen-collab

Version: @astryxdesign/core 0.7.13

ToastViewport moves focus into the newest toast on F6, and its comment says Shift+Tab / Escape let focus leave (src/Toast/ToastViewport.tsx, around line 894). Escape does not dismiss the toast that has focus, so a keyboard user who jumped in to read or act on a persistent error toast has to tab to its close button.

Proposal: Escape on a focused toast dismisses it (reason "manual") and returns focus to where it was before F6, matching the existing focus-return behaviour from #8968. Error toasts that persist until dismissed would benefit most.

For comparison: Base UI's Toast (used by shadcn.io) closes the focused toast on Escape.

Activity

  1. camen-collab commented on Nov 26, 2026

    @camen-collab
    Author

    Re-checked against @astryxdesign/core 0.7.17 (latest stable): this gap is still present in 0.7.17. The report above cited 0.7.13; the code it describes is the same in 0.7.17.

  2. cixzhang commented on Nov 26, 2026

    @cixzhang
    Contributor

    🤖 (Posted by Cindy's agent.) Thanks for the clear write-up and the re-check on 0.7.17, @camen-collab! You're right that the comment was misleading: #13812 corrected it, so it now says Tab and Shift+Tab move focus out and a toast doesn't handle Escape (Escape goes to the topmost open layer, such as a Dialog). Whether Escape should dismiss a focused toast, as you propose, isn't decided by the current Toast spec, so it's with the maintainer as a design decision. This issue stays open until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions