Skip to content

[General] [Fixed] - Fix hover out timeout stored in wrong variable in Pressability#56328

Open
w3di wants to merge 1 commit intofacebook:mainfrom
w3di:fix/pressability-hover-out-timeout
Open

[General] [Fixed] - Fix hover out timeout stored in wrong variable in Pressability#56328
w3di wants to merge 1 commit intofacebook:mainfrom
w3di:fix/pressability-hover-out-timeout

Conversation

@w3di
Copy link
Copy Markdown

@w3di w3di commented Apr 4, 2026

Summary

The onMouseLeave handler in Pressability stores the delayed onHoverOut timeout in _hoverInDelayTimeout instead of _hoverOutDelayTimeout. This is a copy-paste error from the onMouseEnter handler above it.

The Pointer Events path (onPointerLeave, line 593) correctly uses _hoverOutDelayTimeout. The Mouse Events path (onMouseLeave, line 645) incorrectly uses _hoverInDelayTimeout.

This causes:

  • _cancelHoverOutDelayTimeout() to not cancel the pending onHoverOut callback
  • _cancelHoverInDelayTimeout() to incorrectly cancel onHoverOut instead of onHoverIn
  • A pending onHoverIn timeout to be silently overwritten if it exists

Affects non-mobile platforms (web, desktop) when delayHoverOut > 0.

Changelog:

[General] [Fixed] - Fix hover out timeout stored in wrong variable in Pressability

Test Plan

  • All 37 existing Pressability tests pass: yarn jest packages/react-native/Libraries/Pressability/__tests__/Pressability-test.js
  • Prettier and ESLint checks pass.
  • Verified by code inspection: the Pointer Events path (line 593) correctly uses _hoverOutDelayTimeout, the Mouse Events path (line 645) now matches.

… Pressability

The onMouseLeave handler incorrectly assigned the delayed onHoverOut
timeout to _hoverInDelayTimeout instead of _hoverOutDelayTimeout.
This caused _cancelHoverOutDelayTimeout() to not cancel the pending
onHoverOut callback, and _cancelHoverInDelayTimeout() to incorrectly
cancel it instead.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 4, 2026
@facebook-github-tools facebook-github-tools bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant