Skip to content

Commit 58f8d60

Browse files
committed
display contents
1 parent 20cbc9e commit 58f8d60

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/react-native-gesture-handler/src/v3/HostGestureDetector.web.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
4444
};
4545
}, [attachHandlers, detachHandlers]);
4646

47-
return <View ref={viewRef}>{children}</View>;
47+
return (
48+
<View style={{ display: 'contents' }} ref={viewRef}>
49+
{children}
50+
</View>
51+
);
4852
};
4953

5054
export default HostGestureDetector;

packages/react-native-gesture-handler/src/web/handlers/GestureHandler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ export default abstract class GestureHandler implements IGestureHandler {
7777
}
7878

7979
public detach() {
80+
if (this.state === State.ACTIVE) {
81+
this.cancel();
82+
} else {
83+
this.fail();
84+
}
8085
this.propsRef = null;
8186
this.viewRef = null;
8287
this.actionType = null;
8388
this.state = State.UNDETERMINED;
84-
this.fail();
8589

8690
this.delegate.detach();
8791
}

0 commit comments

Comments
 (0)