about summary refs log tree commit diff
path: root/src/components/Dialog
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-10-14 08:02:16 -0700
committerGitHub <noreply@github.com>2024-10-14 08:02:16 -0700
commit432dc867f8965c252c6793c53d3d162aef2a5f94 (patch)
tree3ba1ef1bf31c0315aa90038c673ce13056995bc4 /src/components/Dialog
parent830b4bee9c738576769b75218dadc6b1de1ba3a3 (diff)
downloadvoidsky-432dc867f8965c252c6793c53d3d162aef2a5f94.tar.zst
Fix keyboard hiding alt text input after viewing DMs on iOS (#5739)
Diffstat (limited to 'src/components/Dialog')
-rw-r--r--src/components/Dialog/index.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx
index 73e54ea21..93acad438 100644
--- a/src/components/Dialog/index.tsx
+++ b/src/components/Dialog/index.tsx
@@ -11,6 +11,7 @@ import {
 } from 'react-native'
 import {
   KeyboardAwareScrollView,
+  useKeyboardController,
   useKeyboardHandler,
 } from 'react-native-keyboard-controller'
 import {runOnJS} from 'react-native-reanimated'
@@ -189,7 +190,21 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
   function ScrollableInner({children, style, ...props}, ref) {
     const {nativeSnapPoint, disableDrag, setDisableDrag} = useDialogContext()
     const insets = useSafeAreaInsets()
+    const {setEnabled} = useKeyboardController()
+
     const [keyboardHeight, setKeyboardHeight] = React.useState(0)
+
+    React.useEffect(() => {
+      if (!isIOS) {
+        return
+      }
+
+      setEnabled(true)
+      return () => {
+        setEnabled(false)
+      }
+    })
+
     useKeyboardHandler({
       onEnd: e => {
         'worklet'