Skip to content

Commit

Permalink
fix(drawer): fix drawer clearing interaction handle (#10413)
Browse files Browse the repository at this point in the history
This PR fixes this issue by clearing the interaction handle `onFinish` which is guaranteed to be called after `onStart`.
  • Loading branch information
ricmatsui committed Mar 26, 2022
1 parent 85fff81 commit ee7405e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/drawer/src/views/modern/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default function Drawer({
hideStatusBar(true);
};

const onGestureEnd = () => {
const onGestureFinish = () => {
endInteraction();
};

Expand Down Expand Up @@ -211,7 +211,9 @@ export default function Drawer({
: open;

toggleDrawer(nextOpen, event.velocityX);
runOnJS(onGestureEnd)();
},
onFinish: () => {
runOnJS(onGestureFinish)();
},
});

Expand Down

0 comments on commit ee7405e

Please sign in to comment.