[iOS] Fix wrong pointerType in Hover gesture#3989
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes an incorrect pointer type mapping in the iOS Hover gesture handler. The handler was using the raw UIKit enum value UITouchTypePencil instead of the properly mapped gesture handler enum value RNGestureHandlerStylus, causing incorrect pointer type values to be reported in hover gesture events.
Changes:
- Fixed pointer type mapping in
eventExtraDatamethod to useRNGestureHandlerStylusinstead ofUITouchTypePencil
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Looks good. I tried to test but failed as hovering is only available on iPad Pro (thanks apple). I guess we need to trust @AndreasHogstrom that it fixes his issue 😅
Ok, nevermind. Now the hover pointer type is always set to stylus, this is definetly incorrect....
## Description `Hover` gesture events contain wrong pointer type. Normally, we map `UITouchTypePencil` to `RNGestureHandlerStylus`, but `Hover` used unmapped `UITouchTypePencil` instead. Because those enums map to different values (`UITouchTypePencil = 2` & `RNGestureHandlerStylus = 1`), it caused wrong pointer type to be returned. Fixes #3977 ## Test plan Not yet as now I don't have access to iPad 😞
## Description `Hover` gesture events contain wrong pointer type. Normally, we map `UITouchTypePencil` to `RNGestureHandlerStylus`, but `Hover` used unmapped `UITouchTypePencil` instead. Because those enums map to different values (`UITouchTypePencil = 2` & `RNGestureHandlerStylus = 1`), it caused wrong pointer type to be returned. Fixes #3977 ## Test plan Not yet as now I don't have access to iPad 😞 Co-authored-by: m-bert <63123542+m-bert@users.noreply.github.com>
## Description Cherry pick thread for release 2.31.0 ## List of PRs - #3983 - #3987 - #3989 - #3991 - #4010 - #4015 - #4020 - #4029 - [Already existing] #4039 - #4047 ## Needs double-check - #3964 - [Original commit](560d1b5#diff-3a70a725140527b922181806417d7510bb1c7a19ee9243a0dce4ce7d826ab235) - [Cherry-picked commit](058addc) - Follow up: [85c364a](85c364a) - #4003 - [Original commit](7406046) - [Cherry-picked commit](92b3bca) - #4012 - [Original commit](58c4641) - [Cherry-picked commit](4225660) - This is only TS check so I think it shouldn't break anything - #4023 - [Original commit](3918d8a) - [Cherry-picked commit](e7e8506) - I've checked that only formatting part was skipped, so up to you if you want to check that as well ## Test plan 🚀 --------- Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com> Co-authored-by: Andreas Högström <andreas.hogstrom@navigraph.com> Co-authored-by: YevheniiKotyrlo <44449990+YevheniiKotyrlo@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com> Co-authored-by: David Duarte <34779165+DavidDuarte22@users.noreply.github.com>
Description
Hovergesture events contain wrong pointer type. Normally, we mapUITouchTypePenciltoRNGestureHandlerStylus, butHoverused unmappedUITouchTypePencilinstead.Because those enums map to different values (
UITouchTypePencil = 2&RNGestureHandlerStylus = 1), it caused wrong pointer type to be returned.Fixes #3977
Test plan
Not yet as now I don't have access to iPad 😞