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
{{ message }}
Repository navigation
Pressable: outer onHoverIn fires when the pointer leaves a nested Pressable and the outer Pressable together #2947
Pressable calls useHover with contain: true. When the pointer enters an inner Pressable, the outer one gets onHoverOut, which is expected. When the pointer leaves the inner one, the "unlock" listener calls hoverStart on the outer one. This also occurs when the pointer leaves the outer one in the same move, for example when an overlay opens under a still pointer.
The outer Pressable gets no onHoverIn after the pointer leaves it. When the pointer enters the inner Pressable, the outer hover ends (contain: true). When the pointer then leaves both Pressables, the outer hover stays ended.
Case A: the pointer moves off the blue box onto the page:
703221 ms outer onHoverIn (event: pointerenter)
703222 ms outer onHoverOut (event: pointerenter)
705438 ms outer onHoverIn (event: pointerenter) ← the pointer has already left the outer Pressable
705438 ms outer onHoverOut (event: pointerleave)
Case B, the overlay opens under a pointer that does not move:
769270 ms outer onHoverIn (event: pointerenter)
769271 ms outer onHoverOut (event: pointerenter)
770696 ms inner onPress: the overlay opens
770711 ms outer onHoverIn (event: pointerenter) ← 15 ms after the press, with no pointer move
770711 ms outer onHoverOut (event: pointerleave)
In both cases, the extra onHoverIn has the same timestamp as the next onHoverOut. Both calls come in one event dispatch, before React renders. So a handler that reads the current state in onHoverOut still sees the state from before the onHoverIn. The extra onHoverIn also gets the old pointerenter event from the first hover, not a new event.
Not a duplicate of #1875. This issue does not ask to share hover state with a parent. The contain: true behaviour can stay. The defect is only the extra onHoverIn after the pointer leaves the outer Pressable.
Activity
raajnadar commentedon Nov 2, 2026
Actual behaviour (react-native-web 0.21.4)
Case A: the pointer moves off the blue box onto the page:
703221 ms outer onHoverIn (event: pointerenter)
703222 ms outer onHoverOut (event: pointerenter)
705438 ms outer onHoverIn (event: pointerenter) ← the pointer has already left the outer Pressable
705438 ms outer onHoverOut (event: pointerleave)
Case B, the overlay opens under a pointer that does not move:
769270 ms outer onHoverIn (event: pointerenter)
769271 ms outer onHoverOut (event: pointerenter)
770696 ms inner onPress: the overlay opens
770711 ms outer onHoverIn (event: pointerenter) ← 15 ms after the press, with no pointer move
770711 ms outer onHoverOut (event: pointerleave)
In both cases, the extra onHoverIn has the same timestamp as the next onHoverOut. Both calls come in one event dispatch, before React renders. So a handler that reads the current state in onHoverOut still sees the state from before the onHoverIn. The extra onHoverIn also gets the old pointerenter event from the first hover, not a new event.
Not a duplicate of #1875. This issue does not ask to share hover state with a parent. The contain: true behaviour can stay. The defect is only the extra onHoverIn after the pointer leaves the outer Pressable.
[fix] Pressable: don't restart the outer hover when the pointer leave…