Skip to content

[iOS] Fix wrong pointerType in Hover gesture#3989

Merged
m-bert merged 2 commits into
mainfrom
@mbert/fix-hover-pointerType
Feb 25, 2026
Merged

[iOS] Fix wrong pointerType in Hover gesture#3989
m-bert merged 2 commits into
mainfrom
@mbert/fix-hover-pointerType

Conversation

@m-bert

@m-bert m-bert commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

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 😞

Copilot AI review requested due to automatic review settings February 20, 2026 11:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 eventExtraData method to use RNGestureHandlerStylus instead of UITouchTypePencil

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m-bert m-bert marked this pull request as ready for review February 23, 2026 12:52
@m-bert m-bert requested a review from akwasniewski February 23, 2026 12:52
akwasniewski
akwasniewski previously approved these changes Feb 24, 2026

@akwasniewski akwasniewski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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....

@akwasniewski akwasniewski dismissed their stale review February 24, 2026 19:55

does not work after all

@m-bert m-bert merged commit 1fafb43 into main Feb 25, 2026
3 checks passed
@m-bert m-bert deleted the @mbert/fix-hover-pointerType branch February 25, 2026 11:54
m-bert added a commit that referenced this pull request Apr 2, 2026
## 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 😞
Copilot AI pushed a commit that referenced this pull request Apr 2, 2026
## 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>
m-bert added a commit that referenced this pull request Apr 2, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Hover gesture reports wrong pointerType

3 participants