Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description While working on `LongPress` I've noticed that currently check if pointer is inside view is implemented inside `NativeViewGestureHandler`. I've decided to move it to `GestureHandler` to be able to use it in other places. ### `HitSlop` Current implementation of `containsPointInView` also takes into consideration `HitSlop` property. The only problem is that on `macOS` we cannot detect clicks outside of view using `mouseDown`. This means that `HitSlop` will work only if click was started inside view - clicking on `HitSlop` area won't activate handlers. ## Test plan Tested on example app. You can simply see that `RectButtons` navigate to examples - it doesn't work if `pointerInside` is `false`. <details> <summary>Also tested on the following code:</summary> ```tsx export default function App() { return ( <GestureHandlerRootView style={styles.container}> <RectButton style={styles.button} hitSlop={10} onPress={console.log} /> </GestureHandlerRootView> ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'space-around', alignItems: 'center', }, button: { width: 100, height: 30, borderRadius: 15, backgroundColor: 'crimson', }, }); ``` </details>
- Loading branch information