Add button property mouse events#15819
Add button property mouse events#15819HariniMalothu17 wants to merge 17 commits intomicrosoft:mainfrom
Conversation
Cleanupstalebranch v2
….com/HariniMalothu17/react-native-windows into fix/add-button-property-mouse-events
...crosoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
b9b9b90 to
f51e3bb
Compare
07cfda6 to
267060a
Compare
| @@ -10,6 +10,7 @@ import {AppRegistry, Text, TouchableHighlight, View} from 'react-native'; | |||
| export default class Bootstrap extends React.Component { | |||
There was a problem hiding this comment.
Rather than just adding a playground sample, can you add an actual test page to RNTester, and a E2E test that verifies the behavior so we can verify it doesn't break in the future.
|
Are you sure you need the BaseViewProps.cpp fork? It doesn't look like you are using those new properties? |
Yes, the BaseViewProps.cpp fork is needed. The upstream BaseViewProps.cpp was missing VIEW_EVENT_CASE entries for several W3C pointer event handlers (onPointerDown, onPointerUp, onClick, etc.) in setProp(). Without these entries, the native event bitset never registers these handlers, so pointer events don't fire. I've also contributed this fix upstream to React Native so the fork can be removed once the upstream update is pulled in. |
….com/HariniMalothu17/react-native-windows into fix/add-button-property-mouse-events
Description
Adds support for detecting which mouse button triggered pointer events (left, right, middle, etc.)
and registers missing W3C pointer event handlers in the native event system.
Type of Change
Erase all that don't apply.
Why
PointerEvent.button and PointerEvent.buttons were always 0 in JS pointer events (onPointerDown, onPointerUp), making it impossible to distinguish right-clicks from left-clicks. Additionally, several W3C pointer event handlers (onPointerDown, onPointerUp, onClick, etc.) were never registered in the native event bitset because BaseViewProps::setProp() was missing their VIEW_EVENT_CASE entries.
Resolves #15827 #6410
Screenshots
Testing
Tested in playground
Optional: Describe the tests that you ran locally to verify your changes.
Changelog
Should this change be included in the release notes: yes
Add a brief summary of the change to use in the release notes for the next release.
Microsoft Reviewers: Open in CodeFlow