Skip to content

Commit

Permalink
Fix conflicting assertions for click events (#46633)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46633

There is an assertion in the "basic click test" that [checks](https://github.com/facebook/react-native/blob/d6e0bc7/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventClickTouch.js#L36-L40) that `isPrimary` is set to false. The same assertion suite also does a mouse event [validation](https://github.com/facebook/react-native/blob/d6e0bc7/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventSupport.js#L201-L204) that `isPrimary` is set to true.

This fixes the conflicting assertions, favoring the behavior observed on Firefox, which appears to be more closely aligned with the W3C spec.

## Changelog

[General][Fixed] Fixed issues with W3C PointerEvents testsx

Reviewed By: vincentriemer

Differential Revision: D63336622

fbshipit-source-id: adbfe5e1bc2a5fd7db18ae067f39e719c19c8cda
  • Loading branch information
rozele authored and facebook-github-bot committed Sep 26, 2024
1 parent fc9fcb5 commit 1dcaf82
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ function checkClickEventProperties(
assert_equals(event.nativeEvent.tiltX, 0, 'default tiltX is 0');
assert_equals(event.nativeEvent.tiltY, 0, 'default tiltY is 0');
assert_equals(event.nativeEvent.twist, 0, 'default twist is 0');
assert_equals(
event.nativeEvent.isPrimary,
false,
'default isPrimary is false',
);
}

function PointerEventClickTouchTestCase(props: PlatformTestComponentBaseProps) {
Expand Down

0 comments on commit 1dcaf82

Please sign in to comment.