Skip to content

Commit

Permalink
Fix modal prop (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski committed Sep 22, 2023
1 parent ecb3e24 commit 95c3f96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(function (
setVisible,
closeDrawer,
scaleBackground,
modal,
} = useDrawerContext();
const composedRef = useComposedRefs(ref, drawerRef);

Expand All @@ -688,6 +689,10 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(function (
}}
onPointerDown={onPress}
onPointerDownOutside={(e) => {
if (!modal) {
e.preventDefault();
return;
}
if (keyboardIsOpen.current) {
keyboardIsOpen.current = false;
}
Expand Down

0 comments on commit 95c3f96

Please sign in to comment.