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 with latest from upstream repository #3
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
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](PrismJS/prism@v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
On web, there are cases now in React 18 where componentWillUnmount gets called twice in a row. I think it is related to reactwg/react-18#31. This causes a No handler for tag error since the handler was cleaned up already in the first componentWillUnmount call. To workaround the issue I added a check to no-op of the handler tag is not found. I think this is fine in that case and simpler than tracking whether the handler was cleaned up in the createHandler component.
Description Added duration property to the LongPressGestureHandler events. This change allows checking how long the entire event lasted. Test code ```js import React, { Component } from 'react'; import { StyleSheet, View } from 'react-native'; import { LongPressGestureHandler, LongPressGestureHandlerStateChangeEvent, } from 'react-native-gesture-handler'; export class PressBox extends Component { private onHandlerStateChange = ( event: LongPressGestureHandlerStateChangeEvent ) => { console.log(`Duration: ${event.nativeEvent.duration}`); }; render() { return ( <LongPressGestureHandler onHandlerStateChange={this.onHandlerStateChange} minDurationMs={600}> <View style={styles.box} /> </LongPressGestureHandler> ); } } export default class Example extends Component { render() { return ( <PressBox /> ); } } const styles = StyleSheet.create({ box: { width: 150, height: 150, alignSelf: 'center', backgroundColor: 'plum', margin: 10, zIndex: 200, }, }); ```
## Description The change that this PR reverts was made to fix [this issue](osdnk/react-native-reanimated-bottom-sheet#15) ([which seems to be fixed already](osdnk/react-native-reanimated-bottom-sheet#150)). But by allowing the `PanGestureHandler` to transition from `BEGAN` to the `END` state it introduced a new problem: when a `TapGestureHandler` has a `waitFor` property set with a reference to a `PanGestureHandler` the `TapGestureHandler` will not activate. Here is a quick summary of why it happens: 1. User touches the screen, `ACTION_DOWN` event is sent 2. Both `TapGestureHandler` and `PanGestureHandler` go to `BEGAN` state 3. User lifts the finger, `ACTION_UP` event is sent 4. `TapGestureHandler` tries to become active but has to wait for the `PanGestureHandler` to resolve 5. `PanGestureHandler` transitions to the `END` state 6. Because `PanGestureHandler` did not fail it is assumed it was recognized and all handlers waiting for it are cancelled With this change at step 5. `PanGestureHandler` transitions to the `FAILED` state, and `TapGestureHandler` becomes active, which is expected behavior. Besides that, [the original problem seems to be fixed in another way](osdnk/react-native-reanimated-bottom-sheet#150). ## Test plan This code sample demonstrates the problem and allows to check the solution: ```js import React, { Component } from 'react'; import { createRef } from 'react'; import { StyleSheet, View } from 'react-native'; import { TapGestureHandler, PanGestureHandler, } from 'react-native-gesture-handler'; function getState(s: number) { switch (s) { case 0: return "Undetermined"; case 1: return "Failed"; case 2: return "Began"; case 3: return "Cancelled"; case 4: return "Active"; case 5: return "End"; } return s; } export default class Example extends Component { constructor(props: Record<string, never>) { super(props); this.panHandler = createRef<PanGestureHandler>(); } render() { return ( <PanGestureHandler onHandlerStateChange={(e) => console.log(`Pan: ${getState(e.nativeEvent.state)}`)} ref={this.panHandler}> <View style={styles.home}> <TapGestureHandler onHandlerStateChange={(e) => console.log(`Tap: ${getState(e.nativeEvent.state)}`)} waitFor={this.panHandler}> <View style={styles.button} /> </TapGestureHandler> </View> </PanGestureHandler> ); } } const styles = StyleSheet.create({ home: { width: '100%', height: '100%', alignSelf: 'center', backgroundColor: 'plum', }, button: { width: 100, height: 100, backgroundColor: 'green', alignSelf: 'center', }, }); ```
- Bump react-native from 0.61.2 to 0.62.3 in /ci/e2e (#1511) - Bump react-native from 0.64.0 to 0.64.1 in /examples/Example (#1510) - Bump react-native from 0.64.0 to 0.64.1 (#1509) - Bump color-string from 1.5.3 to 1.5.5 in /docs (#1499) - Bump y18n from 4.0.0 to 4.0.3 (#1498) - Bump y18n from 3.2.1 to 3.2.2 in /ci/e2e (#1497) - Bump postcss from 7.0.32 to 7.0.36 in /docs (#1485) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
`index of` was reading properties and indexes instead of reading only indexes which made the next line `const [key, value] = argMapping[index]` crash
react-native-gesture-handler doesn't work with react-native-windows 0.64+ The reason for this is that react-native-windows runs UIManager as a TurboModule internally, rather than a native module, so the way that react-native-gesture-handler attempts to get the UIManager ends up with an empty object.
Bumps [tar](https://github.com/npm/node-tar) from 6.0.5 to 6.1.4. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v6.0.5...v6.1.4) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Convert RootHelper to Kotlin * Fix type errors * Use template strings * Move init block to the top * Remove null checks * Use apply * Move context into ctor * Rename members * Refine scope functions * Convert ViewConfigurationHelper to Kotlin * Convert ConfigurationHelper to Kotlin * Fix type errors in RootHelper * Join declaration with assignment * Make Views non-nullable * Remove obsolete version checkk * Gather when block * Fix return type of overriden function * Convert GestureUtils to Kotlin * Use ranges * Make ViewConfigurationHelper methods' returns non-nullable * Invert condition
Bumps [tar](https://github.com/npm/node-tar) from 4.4.8 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v4.4.8...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
twstokes
approved these changes
Aug 6, 2021
LGTM @guarani. |
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
Sync with latest from upstream repository to keep fork up-to-date.
Test plan
This PR simply updates our
master
branch with the upstream repo'smaster
branch. Testing will occur in a follow up PR.After merging this PR, the next steps will be:
master
branchwp-fork
branchwp-fork
being up-to-date with the upstream repowp-fork
branch