diff --git a/.changeset/toast-viewport-escape-comment.md b/.changeset/toast-viewport-escape-comment.md new file mode 100644 index 0000000000000..bda4ac8117ead --- /dev/null +++ b/.changeset/toast-viewport-escape-comment.md @@ -0,0 +1,7 @@ +--- +'@astryxdesign/core': patch +--- + +[docs] Toast: a source comment in the toast viewport now says that a toast does not handle Escape, and that the topmost present layer receives it. Behavior is unchanged. + +@cixzhang diff --git a/packages/core/src/Toast/ToastViewport.tsx b/packages/core/src/Toast/ToastViewport.tsx index 20d8b631bbbf0..45b90da091faf 100644 --- a/packages/core/src/Toast/ToastViewport.tsx +++ b/packages/core/src/Toast/ToastViewport.tsx @@ -984,7 +984,9 @@ export function ToastViewport({ // F6 jumps focus into the toast viewport — the standard "go to // notifications" affordance. Focus the first control in the newest toast, // or the viewport container if none. Toasts are non-modal, so this only - // moves focus in; Shift+Tab / Escape let focus leave naturally. + // moves focus in. Tab and Shift+Tab move focus out. A toast does not handle + // Escape. The layer stack sends it to the topmost present layer, such as a + // Dialog that holds the viewport. const hasToasts = toasts.length > 0; useEffect(() => { if (!hasToasts) {