-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix GestureDetector not working when the underlying view changes
#2092
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kmagiera
approved these changes
Jun 6, 2022
|
Great work. |
|
Is there any update? |
hyochan
referenced
this pull request
in hyochan/dooboo-ui
Mar 12, 2023
…266) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-gesture-handler](https://togithub.com/software-mansion/react-native-gesture-handler) | [`~2.8.0` -> `~2.9.0`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.8.0/2.9.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>software-mansion/react-native-gesture-handler</summary> ### [`v2.9.0`](https://togithub.com/software-mansion/react-native-gesture-handler/releases/tag/2.9.0) [Compare Source](https://togithub.com/software-mansion/react-native-gesture-handler/compare/2.8.0...2.9.0) #### ❗ Important changes - Support React Native 0.71 by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2313](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2313) #### 🐛 Bug fixes - Use `ReturnType` instead of explicit `AnimatedInterpolation` type by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2294](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2294) - Fix default `shouldCancelWhenOutside` on iOS and Android by [@​Warus15](https://togithub.com/Warus15) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2297](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2297) - Fix `onBegin` and `onTouchesDown` event ordering on iOS by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2278](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2278) - Fix buttons getting locked in some cases on Android by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2315](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2315) - fix RNGH not working in pnpm project by [@​chj-damon](https://togithub.com/chj-damon) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2334](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2334) - GestureDetector: more checks for mounted component by [@​phryneas](https://togithub.com/phryneas) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2335](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2335) - Fix `GestureDetector` not working when the underlying view changes by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2092](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2092) - Cocoapods: Fix deprecated/removed File.exists method by [@​tomekzaw](https://togithub.com/tomekzaw) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2368](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2368) #### 🔢 Miscellaneous - Update React Native to 0.70.3 in the example apps by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2267](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2267) - Reformat iOS codebase by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2296](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2296) - Update the commit hash in `.git-blame-ignore-revs` by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2306](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2306) - Provide proper Algolia Search API key by [@​kacperkapusciak](https://togithub.com/kacperkapusciak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2308](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2308) - Fix search modal styling in the docs by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2309](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2309) - Bump loader-utils from 2.0.0 to 2.0.3 in /docs by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2311](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2311) - Fixed typo in doc: cancelsToucesInView > cancelsTouchesInView by [@​vidalmaxime](https://togithub.com/vidalmaxime) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2318](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2318) - Bump decode-uri-component from 0.2.0 to 0.2.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2338](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2338) - Bump loader-utils from 2.0.3 to 2.0.4 in /docs by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2321](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2321) - Bump qs from 6.10.1 to 6.11.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2342](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2342) - Bump decode-uri-component from 0.2.0 to 0.2.2 in /FabricExample by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2340](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2340) - \[docs] Fixed doubleTap example in docs by [@​robwalkerco](https://togithub.com/robwalkerco) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2349](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2349) - Bump json5 from 2.2.1 to 2.2.3 in /docs by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2366](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2366) - Bump json5 from 2.2.1 to 2.2.3 in /FabricExample by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2365](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2365) #### New Contributors - [@​vidalmaxime](https://togithub.com/vidalmaxime) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2318](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2318) - [@​chj-damon](https://togithub.com/chj-damon) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2334](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2334) - [@​robwalkerco](https://togithub.com/robwalkerco) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2349](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2349) **Full Changelog**: software-mansion/react-native-gesture-handler@2.8.0...2.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **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://app.renovatebot.com/dashboard#github/dooboolab/dooboo-ui). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNjAuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE2MC4wIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
hyochan
referenced
this pull request
in hyochan/dooboo-ui
Mar 19, 2023
…296) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-gesture-handler](https://togithub.com/software-mansion/react-native-gesture-handler) | [`2.8.0` -> `2.9.0`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.8.0/2.9.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>software-mansion/react-native-gesture-handler</summary> ### [`v2.9.0`](https://togithub.com/software-mansion/react-native-gesture-handler/releases/tag/2.9.0) [Compare Source](https://togithub.com/software-mansion/react-native-gesture-handler/compare/2.8.0...2.9.0) #### ❗ Important changes - Support React Native 0.71 by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2313](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2313) #### 🐛 Bug fixes - Use `ReturnType` instead of explicit `AnimatedInterpolation` type by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2294](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2294) - Fix default `shouldCancelWhenOutside` on iOS and Android by [@​Warus15](https://togithub.com/Warus15) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2297](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2297) - Fix `onBegin` and `onTouchesDown` event ordering on iOS by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2278](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2278) - Fix buttons getting locked in some cases on Android by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2315](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2315) - fix RNGH not working in pnpm project by [@​chj-damon](https://togithub.com/chj-damon) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2334](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2334) - GestureDetector: more checks for mounted component by [@​phryneas](https://togithub.com/phryneas) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2335](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2335) - Fix `GestureDetector` not working when the underlying view changes by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2092](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2092) - Cocoapods: Fix deprecated/removed File.exists method by [@​tomekzaw](https://togithub.com/tomekzaw) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2368](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2368) #### 🔢 Miscellaneous - Update React Native to 0.70.3 in the example apps by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2267](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2267) - Reformat iOS codebase by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2296](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2296) - Update the commit hash in `.git-blame-ignore-revs` by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2306](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2306) - Provide proper Algolia Search API key by [@​kacperkapusciak](https://togithub.com/kacperkapusciak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2308](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2308) - Fix search modal styling in the docs by [@​j-piasecki](https://togithub.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2309](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2309) - Bump loader-utils from 2.0.0 to 2.0.3 in /docs by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2311](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2311) - Fixed typo in doc: cancelsToucesInView > cancelsTouchesInView by [@​vidalmaxime](https://togithub.com/vidalmaxime) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2318](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2318) - Bump decode-uri-component from 0.2.0 to 0.2.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2338](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2338) - Bump loader-utils from 2.0.3 to 2.0.4 in /docs by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2321](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2321) - Bump qs from 6.10.1 to 6.11.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2342](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2342) - Bump decode-uri-component from 0.2.0 to 0.2.2 in /FabricExample by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2340](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2340) - \[docs] Fixed doubleTap example in docs by [@​robwalkerco](https://togithub.com/robwalkerco) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2349](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2349) - Bump json5 from 2.2.1 to 2.2.3 in /docs by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2366](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2366) - Bump json5 from 2.2.1 to 2.2.3 in /FabricExample by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2365](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2365) #### New Contributors - [@​vidalmaxime](https://togithub.com/vidalmaxime) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2318](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2318) - [@​chj-damon](https://togithub.com/chj-damon) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2334](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2334) - [@​robwalkerco](https://togithub.com/robwalkerco) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2349](https://togithub.com/software-mansion/react-native-gesture-handler/pull/2349) **Full Changelog**: software-mansion/react-native-gesture-handler@2.8.0...2.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **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://app.renovatebot.com/dashboard#github/dooboolab/dooboo-ui). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzUuMTEuMCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
GestureDetectorwas not reattaching gestures if the underlying view has changed, which was especially noticeable when using layout animations.This PR updates
GestureDetectorto keep track of the tag of the view it's attached to and to reattach gestures it the tag changes.The second commit also fixes gestures not reattaching when manually changing the underlying view (at the expense of forcing another render), but only when Reanimated is not used.
Applying the following patch:
Expand
Test plan
Tested on the Example app and on the following code:
Expand
Code to test the second commit:
Expand
Change between
ViewandAnimated.Viewwhile the app is running and check if the tap still works. Remove.runOnJS(true)to test using Reanimated.