Skip to content

Commit 14f9368

Browse files
committed
fix undetermined to highlight as default
1 parent 3ab31de commit 14f9368

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • packages/docs-gesture-handler/src/examples/GestureStateFlowExample

packages/docs-gesture-handler/src/examples/GestureStateFlowExample/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ export default function App() {
3434
const isDesktopMode = dimensions.width > MIN_DESKTOP_WIDTH;
3535

3636
useEffect(() => {
37-
resetPan();
38-
resetLongPress();
37+
// Timing issue, neither useEffect, useLayoutEffect or requestAnimationFrame work
38+
const timeout = setTimeout(() => {
39+
resetPan();
40+
resetLongPress();
41+
}, 300);
42+
43+
return () => {
44+
clearTimeout(timeout);
45+
};
3946
}, [resetLongPress, resetPan]);
4047

4148
useEffect(() => {

0 commit comments

Comments
 (0)