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
fix(toast): prevent toasts from collapsing when pointer is hovering (#2771)
* fix(toast): prevent toasts from collapsing when pointer is hovering
When dismissing a toast by clicking the close button while the mouse
is hovering over the toast group, the toasts would immediately collapse
even though the cursor was still within the group. This was caused by
focus restoration triggering browser hover state recalculation.
This fix adds pointer tracking to only restore focus and collapse toasts
when the pointer has actually left the toast group, maintaining the
expected hover behavior.
Changes:
- Add isPointerWithin ref to track mouse position over toast group
- Update REGION.BLUR handler to check pointer position before collapsing
- Add guards: isPointerOut, isOverlappingAndPointerOut
- Add actions: setPointerWithin, clearPointerWithin, clearFocusWithin
- Only restore focus when pointer has left the group
Fixeschakra-ui/ark#3628
* chore: add changeset
* chore: reformat changeset
* fix: toast issue in firefox
* chore: cleanup
* refactor: setTimeout -> raf
* refactor: use animation frame class
---------
Co-authored-by: Segun Adebayo <[email protected]>
0 commit comments