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 hitSlop on Gesture Handler buttons #2039

Merged
merged 12 commits into from
Aug 9, 2023
Merged

Conversation

j-piasecki
Copy link
Member

Description

This PR does two things:

  • (iOS) sets hitTestEdgeInsets on RNGestureHandlerButton when Fabric is enabled
  • (Android) sets clipChildren to false on ButtonViewGroup

The second change makes the button behavior consistent with iOS where its content isn't clipped. It also fixes #1242 because of this line, which tried to extract handlers from view when it's not clipping children.

Test plan

Tested on the Example app.

@hirbod
Copy link

hirbod commented May 6, 2022

@j-piasecki RN 0.68.1 does support single value hitSlop values now (together with the old object notation - hitSlop={10})
Would you consider to also add this to be more streamlined with RN?

@j-piasecki
Copy link
Member Author

@hirbod It should be possible already, because the hitSlop property is transformed when it's not an object. I tried it on a simple touchable and it worked fine, although the types seem to be wrong, I'll look into it.

@lightrow
Copy link

lightrow commented Sep 5, 2022

can this please be looked at? This is a major annoyance

@magrinj
Copy link
Contributor

magrinj commented May 10, 2023

@j-piasecki Are you able to get this merged soon ? I'm facing the same issue on my side too mostly on Android devices, it's really annoying and frustrating for the users

@j-piasecki j-piasecki merged commit 04ed17e into main Aug 9, 2023
8 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/improve-hitslop branch August 9, 2023 15:04
renovate bot referenced this pull request in valora-inc/wallet Oct 5, 2023
…4264)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler)
| [`^2.12.1` ->
`^2.13.1`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.12.1/2.13.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-gesture-handler/2.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-gesture-handler/2.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-gesture-handler/2.12.1/2.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-gesture-handler/2.12.1/2.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-gesture-handler
(react-native-gesture-handler)</summary>

###
[`v2.13.1`](https://github.com/software-mansion/react-native-gesture-handler/releases/tag/2.13.1)

[Compare
Source](https://github.com/software-mansion/react-native-gesture-handler/compare/2.13.0...2.13.1)

#### 🐛 Bug fixes

- Hotfix: Hover not working on web by
[@&#8203;pepyta](https://github.com/pepyta) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2593](https://github.com/software-mansion/react-native-gesture-handler/pull/2593)

#### New Contributors

- [@&#8203;pepyta](https://github.com/pepyta) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2593](https://github.com/software-mansion/react-native-gesture-handler/pull/2593)

**Full Changelog**:
software-mansion/react-native-gesture-handler@2.13.0...2.13.1

###
[`v2.13.0`](https://github.com/software-mansion/react-native-gesture-handler/releases/tag/2.13.0)

[Compare
Source](https://github.com/software-mansion/react-native-gesture-handler/compare/2.12.1...2.13.0)

#### ❗ Important changes

- Add `Hover` gesture by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2455](https://github.com/software-mansion/react-native-gesture-handler/pull/2455)

#### 🐛 Bug fixes

- Only cancel JS responder when activating recognizer comes from Gesture
Handler by [@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2533](https://github.com/software-mansion/react-native-gesture-handler/pull/2533)
- Make manual activation recognizer not cancel `UIControls` by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2545](https://github.com/software-mansion/react-native-gesture-handler/pull/2545)
- fix: export SwipeableProps by
[@&#8203;G07cha](https://github.com/G07cha) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2561](https://github.com/software-mansion/react-native-gesture-handler/pull/2561)
- Fix Reanimated worklet recognition on Fabric by
[@&#8203;t0ms0n00](https://github.com/t0ms0n00) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2555](https://github.com/software-mansion/react-native-gesture-handler/pull/2555)
- Android TalkBack fix by [@&#8203;m-bert](https://github.com/m-bert)
in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2234](https://github.com/software-mansion/react-native-gesture-handler/pull/2234)
- Continuously check for pointer capture on web by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2563](https://github.com/software-mansion/react-native-gesture-handler/pull/2563)
- fix: export Touchable\* component props by
[@&#8203;G07cha](https://github.com/G07cha) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2556](https://github.com/software-mansion/react-native-gesture-handler/pull/2556)
- Don't create a `RippleDrawable` when the color is transparent by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2575](https://github.com/software-mansion/react-native-gesture-handler/pull/2575)
- Fix `hitSlop` on Gesture Handler buttons by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2039](https://github.com/software-mansion/react-native-gesture-handler/pull/2039)
- Improve multi-pointer behavior (with ScrollView) on Android by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2551](https://github.com/software-mansion/react-native-gesture-handler/pull/2551)
- Fix ripple effect staying after cancellation by
[@&#8203;m-bert](https://github.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2586](https://github.com/software-mansion/react-native-gesture-handler/pull/2586)
- Fix react-android not found error on android by
[@&#8203;lauhon](https://github.com/lauhon) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2568](https://github.com/software-mansion/react-native-gesture-handler/pull/2568)

#### 👍 Improvements

- `activeCursor` prop by [@&#8203;m-bert](https://github.com/m-bert)
in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2550](https://github.com/software-mansion/react-native-gesture-handler/pull/2550)
- Update default Android SDK versions by
[@&#8203;makito013](https://github.com/makito013) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2537](https://github.com/software-mansion/react-native-gesture-handler/pull/2537)
- Recycle obtained `MotionEvents` on Android by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2523](https://github.com/software-mansion/react-native-gesture-handler/pull/2523)
- Documentation: link leading to a 404 fix by
[@&#8203;orpos](https://github.com/orpos) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2553](https://github.com/software-mansion/react-native-gesture-handler/pull/2553)
- Decouple the JS implementation from the web APIs by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2579](https://github.com/software-mansion/react-native-gesture-handler/pull/2579)
- Remove multiple instances check when building by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2569](https://github.com/software-mansion/react-native-gesture-handler/pull/2569)

#### 🔢 Miscellaneous

- Bump fast-xml-parser from 4.1.3 to 4.2.4 in /example by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2512](https://github.com/software-mansion/react-native-gesture-handler/pull/2512)
- Bump fast-xml-parser from 4.2.2 to 4.2.4 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2511](https://github.com/software-mansion/react-native-gesture-handler/pull/2511)
- Bump activesupport from 6.1.7.2 to 7.0.5 in /example by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2509](https://github.com/software-mansion/react-native-gesture-handler/pull/2509)
- Bump shell-quote from 1.7.2 to 1.8.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2521](https://github.com/software-mansion/react-native-gesture-handler/pull/2521)
- Bump tough-cookie from 4.0.0 to 4.1.3 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2531](https://github.com/software-mansion/react-native-gesture-handler/pull/2531)
- Bump semver from 5.7.1 to 5.7.2 in /example by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2540](https://github.com/software-mansion/react-native-gesture-handler/pull/2540)
- Bump semver from 5.7.1 to 5.7.2 in /docs by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2539](https://github.com/software-mansion/react-native-gesture-handler/pull/2539)
- Bump fast-xml-parser from 4.2.4 to 4.2.5 in /example by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2535](https://github.com/software-mansion/react-native-gesture-handler/pull/2535)
- Bump semver from 5.7.1 to 5.7.2 in /e2e/web-tests by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2541](https://github.com/software-mansion/react-native-gesture-handler/pull/2541)
- Bump semver from 5.7.1 to 5.7.2 in /FabricExample by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2542](https://github.com/software-mansion/react-native-gesture-handler/pull/2542)
- Bump semver from 5.7.1 to 5.7.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2538](https://github.com/software-mansion/react-native-gesture-handler/pull/2538)
- Bump fast-xml-parser from 4.2.4 to 4.2.5 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2534](https://github.com/software-mansion/react-native-gesture-handler/pull/2534)
- Bump word-wrap from 1.2.3 to 1.2.4 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2547](https://github.com/software-mansion/react-native-gesture-handler/pull/2547)
- Bump word-wrap from 1.2.3 to 1.2.4 in /example by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2548](https://github.com/software-mansion/react-native-gesture-handler/pull/2548)
- Bump word-wrap from 1.2.3 to 1.2.4 in /FabricExample by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2549](https://github.com/software-mansion/react-native-gesture-handler/pull/2549)
- Update `docusaurus` to 2.3.1 by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2423](https://github.com/software-mansion/react-native-gesture-handler/pull/2423)
- Add empty example by [@&#8203;m-bert](https://github.com/m-bert) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2564](https://github.com/software-mansion/react-native-gesture-handler/pull/2564)
- Add description to `averageTouches` in the documentation by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2352](https://github.com/software-mansion/react-native-gesture-handler/pull/2352)
- Update the team in docs by
[@&#8203;j-piasecki](https://github.com/j-piasecki) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2565](https://github.com/software-mansion/react-native-gesture-handler/pull/2565)
- Bump activesupport from 7.0.5 to 7.0.7.2 in /example by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2574](https://github.com/software-mansion/react-native-gesture-handler/pull/2574)
- Create FUNDING.yml by [@&#8203;aleqsio](https://github.com/aleqsio)
in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2587](https://github.com/software-mansion/react-native-gesture-handler/pull/2587)

#### New Contributors

- [@&#8203;makito013](https://github.com/makito013) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2537](https://github.com/software-mansion/react-native-gesture-handler/pull/2537)
- [@&#8203;orpos](https://github.com/orpos) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2553](https://github.com/software-mansion/react-native-gesture-handler/pull/2553)
- [@&#8203;t0ms0n00](https://github.com/t0ms0n00) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2555](https://github.com/software-mansion/react-native-gesture-handler/pull/2555)
- [@&#8203;G07cha](https://github.com/G07cha) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2561](https://github.com/software-mansion/react-native-gesture-handler/pull/2561)
- [@&#8203;lauhon](https://github.com/lauhon) made their first
contribution in
[https://github.com/software-mansion/react-native-gesture-handler/pull/2568](https://github.com/software-mansion/react-native-gesture-handler/pull/2568)

**Full Changelog**:
software-mansion/react-native-gesture-handler@2.12.0...2.13.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjMiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jean Regisser <jean.regisser@gmail.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
5 participants