1- import React , { useEffect , useRef } from 'react'
1+ import React , { useEffect , useMemo } from 'react'
22import { Sheet , SheetProps } from 'react-modal-sheet'
33
4- import { useSheetStore , useChatStore } from '@stores'
4+ import { useSheetStore , useChatStore , useStore } from '@stores'
55import FilterModal from '@components/pages/document/components/FilterModal'
66import NotificationModal from './notificationPanel/mobile/NotificationModal'
77import ChatContainerMobile from './pages/document/components/chat/ChatContainerMobile'
@@ -14,6 +14,11 @@ const BottomSheet = () => {
1414 const destroyChatRoom = useChatStore ( ( state ) => state . destroyChatRoom )
1515 const setSheetContainerRef = useSheetStore ( ( state ) => state . setSheetContainerRef )
1616 const { height : keyboardHeight } = useKeyboardHeight ( )
17+ const { deviceDetect } = useStore ( ( state ) => state . settings )
18+
19+ const isDeviceIOS = useMemo ( ( ) => {
20+ return deviceDetect ?. os ( ) === 'iOS'
21+ } , [ deviceDetect ] )
1722
1823 // Sync chat store with bottom sheet
1924 useEffect ( ( ) => {
@@ -62,12 +67,12 @@ const BottomSheet = () => {
6267 case 'filters' :
6368 return {
6469 // Fix the bottom sheet height when keyboard is open
65- style : { paddingBottom : keyboardHeight }
70+ style : { paddingBottom : isDeviceIOS ? keyboardHeight : 0 }
6671 }
6772 case 'chatroom' :
6873 return {
6974 style : {
70- paddingBottom : keyboardHeight
75+ paddingBottom : isDeviceIOS ? keyboardHeight : 0
7176 } ,
7277 disableDrag : true ,
7378 disableScrollLocking : true
0 commit comments