This repository was archived by the owner on Jul 27, 2023. It is now read-only.
forked from software-mansion/react-native-gesture-handler
-
Notifications
You must be signed in to change notification settings - Fork 0
Sync latest from upstream repo into wp-fork branch #4
Open
guarani
wants to merge
101
commits into
wp-fork
Choose a base branch
from
master-to-wp-fork
base: wp-fork
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
* Release 1.10.2 * Update Podfile.lock
ReturnType<typeof setTimeout> should resolve to either RN or NodeJS version, depending on what project includes.
This removes the React Native warning: *Accessing view manager configs directly off UIManager via UIManager['getConstants'] is no longer supported. Use UIManager.getViewManagerConfig('getConstants') instead.*
Co-authored-by: Tomasz Sapeta <tsapeta@users.noreply.github.com>
Babel TS types plugin doesn't check if something is a value or a type so types in export weren't stripped.
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.21.0 to 1.23.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](PrismJS/prism@v1.21.0...v1.23.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.3...v6.5.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ion#1394) Co-authored-by: Jakub Gonet <jgonet@MacBook-Pro-Jakub.local>
## Description Typescript includes types even if they're not explicitly imported. This behavior makes some declaration types in Gesture Handler include node's typings which isn't desired since React Native shadows some declarations from Node (e.g. [`setInterval`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d14f07228ede33b23717f978c1f395d9570653cf/types/react-native/globals.d.ts#L12)). We're utilizing [`types`](https://www.typescriptlang.org/tsconfig#types) property to prevent TS from including all definitions from `node_modules/@types`. Hopefully, finally fixes software-mansion#1384 ### References - [Discussion about _excluding_ some packages' definitions and TS maintainer response](microsoft/TypeScript#18588 (comment)) - [PR in TS introducing opaque type definitions](microsoft/TypeScript#31894) - this can prevent those type of issues in the future
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](npm/ssri@v6.0.1...v6.0.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.21 to 0.7.28. - [Release notes](https://github.com/faisalman/ua-parser-js/releases) - [Commits](faisalman/ua-parser-js@0.7.21...0.7.28) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ion#1458) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…re-mansion#1463) Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](npm/hosted-git-info@v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#1462) Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](npm/hosted-git-info@v2.7.1...v2.8.9) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.8.2 to 4.16.6. - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](browserslist/browserslist@4.8.2...4.16.6) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Gonet <jakub.gonet@swmansion.com>
…nsion#1559) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Move handler tag generation and id to tag map to separate file * Move allowed props to separate file * Rename gestureHandlers to gestureHandlerCommon * Split gestureHandlers.ts into separate files for every handler * Update comment
Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com>
## Description After updating from 1.8.0 to 1.10.3 some of my users reported problems about buttons getting stuck on Android. In software-mansion#1172 an override for `onTouchEvent` was introduced to block subsequent calls. A check for event times was added with the assumption that every event will have a different event time. You can find further information in software-mansion#1172 (comment) and in the Javadoc of `onTouchEvent`. Unfortunately, events with the same event time can indeed occur on some devices for different actions, which has glaring consequences. Some of my users and myself experienced situations where - after a quick touch - the ripple effect was halted, the onPress was not fired, no touch sound was played and no other button was accepting any inputs. It seemed like the app thought the finger was still on the button. This is due to the following sequence of events sometimes happening (fictional event times): 1. `ACTION_DOWN` is sent at EventTime 1000 2. `ACTION_MOVE` is sent at EventTime 2000 (Android sends at least one, even without a move) 3. `ACTION_UP` is **also** sent at EventTime 2000, resulting in not being handled and keeping the button touched Furthermore, my thesis is confirmed by the fact that touching the same button again is sending another `ACTION_UP` and thus the and all other buttons are unstucked. The problem can even be forced to a certain extent by combining the quick touch with a small swiping gesture, which sends even more `ACTION_MOVE` events. The only inexplicable part for me is that the frequency of this issue happening varies greatly from device to device. It happened every ~5 touches on a Huawei P30 (and on nearly every touch with the little forced swipe), infrequently but multiple times on a Samsung Galaxy S21, and couldn't be reproduced on an Oppo Find X2 Lite, LG G6, and the Android emulator. It is also worth mentioning that a reproduction on statically placed buttons is easier, since buttons in scrollable views send an `ACTION_CANCEL` instead of an `ACTION_UP` on the slightest movement in the scrolling direction. I have so far not had a case where those event times were the same. ## How it's fixed - Analogous to the check of the last event time, I have added another check for the last action. - Because 0 is a possible value for an action (`ACTION_DOWN` with first pointer), I set the initial value to -1. To keep everything consistent, I've also set the default value of the event time to -1. - By using `getAction` instead of `getActionMasked`, this solution is also pointer-sensitive. - Of course I have also expanded the Javadoc. :) After implementing these changes, I was no longer able to reproduce the issue on the P30 and S21 (or the other devices). ## Considerations This is kind of an extension to @jakub-gonet's assumption that there will not be two or more events that have the same event time and action in immediate succession. There may still be another way in which unexpected consequences can occur, but my change ensures that the problems that have arisen so far in my app in production under normal use are eliminated. In addition, the check in `onTouchEvent` is much more robust. Even if it did not happen in my tests, I can also very well imagine that the same event time could occur within scrollable views between `ACTION_MOVE` and `ACTION_CANCEL`. If so, my change would prevent such problems as well. ## Test plan Tested with the example code of software-mansion#1172 on the above mentioned 5 devices, where I appended the following `BaseButton` and `RectButton`. The fix naturally applies to all Touchables since they use `BaseButton` internally. ```jsx import { BaseButton, RectButton, } from 'react-native-gesture-handler'; ... <> <BaseButton style={{ width: 200, height: 50, backgroundColor: 'lightgreen', }} onPress={() => console.log('pressed RNGH BaseButton')}> <Text>RNGH BaseButton</Text> </BaseButton> <RectButton style={{ width: 200, height: 50, backgroundColor: 'lightgreen', }} onPress={() => console.log('pressed RNGH RectButton')}> <Text>RNGH RectButton</Text> </RectButton> </> ``` Co-authored-by: Jakub Gonet <jakub.gonet@swmansion.com>
Adds CI based on github actions.
… no minDist set (software-mansion#1594) When using custom activation (or failure) criteria, without setting the minDist prop, the default value would default to Float.MAX_VALUE, making it impossible to activate the handler. This changes it to Float.MIN_VALUE which is also the default value in the resetConfig method.
Co-authored-by: Jakub Gonet <jakub.gonet@swmansion.com>
043f6d9
to
2e43de7
Compare
2e43de7
to
346bde3
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Follow up to #3. This PR brings changes from the upstream repo into the
wp-fork
branch here, which will then be tagged and used by Gutenberg Mobile.Test plan
master-to-wp-fork
branch