Skip to content

Commit

Permalink
Merge pull request #1 from ngxhuyhoang/main
Browse files Browse the repository at this point in the history
fix: cannot open panel on android
  • Loading branch information
purrseus authored Dec 5, 2024
2 parents 0d56044 + 68992d4 commit 035c879
Show file tree
Hide file tree
Showing 2 changed files with 1,441 additions and 1,433 deletions.
14 changes: 11 additions & 3 deletions src/ui/components/bubble/InspectorBubble.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { useContext, useRef, type MutableRefObject } from 'react';
import { Animated, Image, PanResponder, StyleSheet } from 'react-native';
import {
Animated,
Image,
PanResponder,
StyleSheet,
type PanResponderGestureState,
} from 'react-native';
import InspectorContext from '../../contexts/InspectorContext';

interface InspectorBubbleProps {
Expand Down Expand Up @@ -27,8 +33,10 @@ export default function InspectorBubble({ bubbleSize, pan }: InspectorBubbleProp
onPanResponderMove: Animated.event([null, { dx: pan.current.x, dy: pan.current.y }], {
useNativeDriver: false,
}),
onPanResponderRelease: (_, gesture) => {
if (!gesture.moveX && !gesture.moveY) showInspectorPanel();
onPanResponderRelease: (_, gesture: PanResponderGestureState) => {
if (gesture.dx < 10 && gesture.dx > -10 && gesture.dy < 10 && gesture.dy > -10) {
showInspectorPanel();
}

pan.current.flattenOffset();

Expand Down
Loading

0 comments on commit 035c879

Please sign in to comment.