Skip to content

Commit

Permalink
disable keyboard controller in the composer screen (#4399)
Browse files Browse the repository at this point in the history
* disable keyboard controller in the composer screen

* add comment

* oops

* destructure

* rename to keyboard context for clarity

* move destructure

* cleanup
  • Loading branch information
haileyok authored Jun 6, 2024
1 parent fef16e0 commit 885ad2c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/view/com/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import {
KeyboardAvoidingView,
KeyboardStickyView,
useKeyboardContext,
} from 'react-native-keyboard-controller'
import Animated, {
interpolateColor,
Expand Down Expand Up @@ -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('')
Expand Down

0 comments on commit 885ad2c

Please sign in to comment.