Skip to content

Commit 1db1fe3

Browse files
committed
fix(mobile): close sheet when backdrop is tapped
1 parent 3c0cb60 commit 1db1fe3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/webapp/components/BottomSheet.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const BottomSheet = () => {
1414
const destroyChatRoom = useChatStore((state) => state.destroyChatRoom)
1515
const setSheetContainerRef = useSheetStore((state) => state.setSheetContainerRef)
1616
const setSheetState = useSheetStore((state) => state.setSheetState)
17+
const sheetState = useSheetStore((state) => state.sheetState)
1718
const { keyboardHeight, virtualKeyboardState } = useStore((state) => state)
1819
const { deviceDetect } = useStore((state) => state.settings)
1920
const sheetContentRef = useRef<HTMLDivElement>(null)
@@ -80,6 +81,7 @@ const BottomSheet = () => {
8081
if (activeSheet === 'chatroom') {
8182
closeChatRoom()
8283
destroyChatRoom()
84+
closeSheet()
8385
} else if (activeSheet === 'emojiPicker' && sheetData.chatRoomState) {
8486
const { headingId } = sheetData.chatRoomState
8587
PubSub.publish(CHAT_OPEN, {
@@ -109,7 +111,7 @@ const BottomSheet = () => {
109111
default:
110112
return
111113
}
112-
}, [sheetContentRef, activeSheet, keyboardHeight, isDeviceIOS, virtualKeyboardState])
114+
}, [sheetContentRef, activeSheet, keyboardHeight, isDeviceIOS, virtualKeyboardState, sheetState])
113115

114116
// NOTE: these events are more reliable than the other events for sheet state
115117
const onOpenEndHandler = () => setSheetState('closed')

0 commit comments

Comments
 (0)