Skip to content

Commit

Permalink
feat: add support for multiple bottom sheets.
Browse files Browse the repository at this point in the history
  • Loading branch information
azabraao committed Dec 21, 2023
1 parent 2cc6817 commit f1bf174
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ const BottomSheet = ({

useEffect(() => {
if (isOpen) lockBodyScroll();
else unlockBodyScroll();
else {
const isAnyOtherBottomSheetOpen =
document.querySelectorAll(".BottomSheet--open")?.length;
if (!isAnyOtherBottomSheetOpen) unlockBodyScroll();
}
}, [isOpen]);

const onDragging = useCallback<DraggableEventHandler>(
Expand Down

0 comments on commit f1bf174

Please sign in to comment.