disable keyboard controller in the composer screen (#4399)

* disable keyboard controller in the composer screen

* add comment

* oops

* destructure

* rename to keyboard context for clarity

* move destructure

* cleanup
zio/stable
Hailey 2024-06-06 12:15:36 -07:00 committed by GitHub
parent fef16e060f
commit 885ad2c756
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import {
import {
KeyboardAvoidingView,
KeyboardStickyView,
useKeyboardContext,
} from 'react-native-keyboard-controller'
import Animated, {
interpolateColor,
@ -129,6 +130,17 @@ export const ComposePost = observer(function ComposePost({
const {closeAllDialogs} = useDialogStateControlContext()
const t = useTheme()
// Disable this in the composer to prevent any extra keyboard height being applied.
// See https://github.com/bluesky-social/social-app/pull/4399
const {setEnabled} = useKeyboardContext()
React.useEffect(() => {
setEnabled(false)
return () => {
setEnabled(true)
}
}, [setEnabled])
const [isKeyboardVisible] = useIsKeyboardVisible({iosUseWillEvents: true})
const [isProcessing, setIsProcessing] = useState(false)
const [processingState, setProcessingState] = useState('')