You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when more than 2 toasts are visible, and focus is move to the oldest toast, when clicking Escape, 2 Toasts are getting removed instead of the focused toast.
Expected behavior
Expectation is that only the focused toast is removed.
2 toasts are removed instead of a single, currently focused toast.
Suggested solution
According to my investigation (might be wrong though), after making the useEscapeKeyDown handler a capturing event listener, the order in which event handlers responsible for toast focus management are fired is reversed.
The text was updated successfully, but these errors were encountered:
jaknas
changed the title
Focused Toast removal with Escape key broken in 1.1.6-rc.1
Focused Toast removal with Escape key broken after 1.1.6-rc.1Jun 24, 2024
Bug report
Current Behavior
toast-escape-removal.mov
Currently, when more than 2 toasts are visible, and focus is move to the oldest toast, when clicking Escape, 2 Toasts are getting removed instead of the focused toast.
Expected behavior
Expectation is that only the focused toast is removed.
Reproducible example
CodeSandbox Template
Suggested solution
According to my investigation (might be wrong though), after making the
useEscapeKeyDown
handler a capturing event listener, the order in which event handlers responsible for toast focus management are fired is reversed.Previously:
onKeyDown
onEscapeKeyDown
Now:
onEscapeKeyDown
onKeyDown
This causes the ref flags to not be set in a correct ore
Additional context
The bug is caused by #2761
Your environment
The text was updated successfully, but these errors were encountered: