Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable #855

Merged
merged 17 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Libraries/Components/Pressable/Pressable.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
delayLongPress,
disabled,
focusable,
onMouseEnter, // [TODO(macOS GH#774)
onMouseLeave, // ]TODO(macOS GH#774)
onLongPress,
onPress,
onPressIn,
Expand Down Expand Up @@ -208,6 +210,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
android_disableSound,
delayLongPress,
delayPressIn: unstable_pressDelay,
onHoverIn: onMouseEnter, // [TODO(macOS GH#774)
onHoverOut: onMouseLeave, // ]TODO(macOS GH#774)
onLongPress,
onPress,
onPressIn(event: PressEvent): void {
Expand Down Expand Up @@ -236,6 +240,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
delayLongPress,
disabled,
hitSlop,
onMouseEnter, // [TODO(macOS GH#774)
onMouseLeave, // ]TODO(macOS GH#774)
onLongPress,
onPress,
onPressIn,
Expand Down
58 changes: 29 additions & 29 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
DoubleConversion: 0ea4559a49682230337df966e735d6cc7760108e
FBLazyVector: f3a2bccaa26e739c3ef011f4ca86c3ca5427eee6
FBReactNativeSpec: 284873b891962e396668ece89aa3290221b560f6
FBLazyVector: 3e1c4c346ec478750c07d0f1d89b424d96cac528
FBReactNativeSpec: 49208bf2f791afd2253440847299776bdcdbc96f
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
Expand All @@ -522,35 +522,35 @@ SPEC CHECKSUMS:
glog: 0dc7efada961c0793012970b60faebbd58b0decb
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
RCT-Folly: 2f2111690f1e23490285c059ca53be22fe6d6bee
RCTRequired: 892b1fc61efc4f66a92b9c6ca85e2522e051f0e2
RCTTypeSafety: 94bdbb3ebfd2fcc54174c5eb66486cbfac50fe60
React: c6d1cfc7cb81cde55e07be8c1411fcdb14161562
React-callinvoker: 577cf455f9e762be4e2b03e03fc0b267a2cff771
React-Core: d8c133ae796db1854204a1f260ef6e3837f1285c
React-CoreModules: 23672f86dd25805b0a9096692b139e26116c1980
React-cxxreact: 1f21c1a08237692657816d8092f3d1dc6f13fb41
React-jsi: e42a0922ac3286bbfc1840aebba8e41fdfcc98d7
React-jsiexecutor: 161f172db05ec4ae77be65940206ba29930355a4
React-jsinspector: 680bd24100071d26698fef4e9c75cf69db027954
React-perflogger: 3a28a552bc5c0be0e8cdcf9f2977aea59eba7380
React-RCTActionSheet: 06144b4bb931c8f217afba1cd620a682cce980fa
React-RCTAnimation: 8b89532952beb474e0d2b3fbe1bdb3e107026551
React-RCTBlob: c83099e47b7a9c1aeeb584b8696abc9f78adf3f1
React-RCTImage: 69061c1547f728421a0aa09a2f1147f59c0d873c
React-RCTLinking: 341ac25287553e51b319266245ef03c36169c671
React-RCTNetwork: 1ab7893ac9d21d03da65ac958271405def8fe43a
React-RCTPushNotification: e5353eb3f501048e032cda7f9491105cc70039a0
React-RCTSettings: fa2839bad861f0d44c223938658e9e7782074c55
React-RCTTest: ca048e75c0b296329201ea81b9f14d27ddd41823
React-RCTText: d2c121533280c59313f002e6575118b877dd40fc
React-RCTVibration: c53993ba40851fc666c350da5269556b1c1470a4
React-runtimeexecutor: 87ba843187b8bebb4111c8c54f199cd4785d2ee3
RCTRequired: 6ef1ca4d8dc14cfdd1c37f14eb4137badd10e982
RCTTypeSafety: 903e3df81eaa3809cd3593f10de14c4bdd29f500
React: c49df3a16180bd95f195f359dd2e08555147b95d
React-callinvoker: aec8865b89dbb1cd8d6cbe782badf4d7495682c9
React-Core: 27db1d573718bb6d53fef2f1dc93c1fdb0d5699d
React-CoreModules: 554ae8216e1963fcfc0ba8aa539a69ad0e0e64ab
React-cxxreact: 841ef739ed5009a9a2e034af90fd7c5157a44790
React-jsi: 4b7f4a5733a77130579aa2b2af3c7963ea5f58c0
React-jsiexecutor: 56d0bf876000abf04e757f3cbd6795d257466b6d
React-jsinspector: 6ddd209772e5b066824a030da0e81a949c8bc45b
React-perflogger: 112849bd1692d40371bcb528e6cd37f6e97da42e
React-RCTActionSheet: b2bedbbb047c24e34304e5e6332182c81fbde3c4
React-RCTAnimation: 88a7a4272ba2142484d5310fa7450d2e65e58cea
React-RCTBlob: 19acefd489b5c3493a92c1f5c0e3d9eac8d05e46
React-RCTImage: 723ec9d61d7f68e6be2e28fb7064d29902c534ac
React-RCTLinking: 2d7559d3c705da2474cd9c47351d029600a1f037
React-RCTNetwork: 36c561fb46ebe56891a401fa6559fd6eae1fcf33
React-RCTPushNotification: 993a3510ea377519306a04d69970ebc9867e25e2
React-RCTSettings: f3e5ffe73ea7831d98b2d0a119102d9ba232774c
React-RCTTest: d56fa23c7ae8c29236cfb2cd7389337c81f6455b
React-RCTText: 627606cbb59d72a924eed4257ebae197b0570757
React-RCTVibration: b212ea311c7b325cabd4d780cc337cff23d40f63
React-runtimeexecutor: 04275caf6c4b2128dcbafcfa015def1782d84760
React-TurboModuleCxx-RNW: 12172bdbaaf052406ec571465243fad4b2eb2702
React-TurboModuleCxx-WinRTPort: 32917c4b48bbe4bb20ce172c40c3cd6315354c3e
ReactCommon: f4a3480837fc8e5c73ffc38c057594b3a1ec7a43
Yoga: 9defa6fd4bf71cdbba9b1389adb9deed6255f4b1
React-TurboModuleCxx-WinRTPort: 9fbcbcbfed07bdacde7fde7f85773e705f2a9c1e
ReactCommon: 91962a733289a96984bc8c761b08ed23c0fbe5f8
Yoga: 9cd54ce33d6f399a07a78172b0c8d7b89a9fc2c5
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: cb260f8f7765c910b68f8267cbd74709f6ae6e54

COCOAPODS: 1.10.1
COCOAPODS: 1.11.0
2 changes: 2 additions & 0 deletions packages/rn-tester/js/examples/Pressable/PressableExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ function PressableFeedbackEvents() {
testID="pressable_feedback_events_button"
accessibilityLabel="pressable feedback events"
accessibilityRole="button"
onMouseEnter={() => appendEvent('mouseEnter')} // [TODO(macOS GH#774)
onMouseLeave={() => appendEvent('mouseLeave')} // ]TODO(macOS GH#774)
onPress={() => appendEvent('press')}
onPressIn={() => appendEvent('pressIn')}
onPressOut={() => appendEvent('pressOut')}
Expand Down