Skip to content

Commit 8e0a312

Browse files
committed
fix(toast): improve Firefox compatibility for hover state
Use double requestAnimationFrame for blur handling to ensure hover state is properly settled before processing blur events. This fixes the issue where Firefox would still collapse toasts when hovering due to different timing in hover state recalculation.
1 parent 11d4959 commit 8e0a312

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/machines/toast/src/toast-group.connect.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export function groupConnect<T extends PropTypes, O = any>(
5050
},
5151
onBlur(event) {
5252
if (refs.get("isFocusWithin") && !contains(event.currentTarget, event.relatedTarget)) {
53-
queueMicrotask(() => send({ type: "REGION.BLUR" }))
53+
// Double RAF for Firefox compatibility - ensures hover state is properly settled
54+
requestAnimationFrame(() => {
55+
requestAnimationFrame(() => {
56+
send({ type: "REGION.BLUR" })
57+
})
58+
})
5459
}
5560
},
5661
})

0 commit comments

Comments
 (0)