about summary refs log tree commit diff
path: root/src/view/com/composer/Composer.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/composer/Composer.tsx')
-rw-r--r--src/view/com/composer/Composer.tsx20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index f2e3cbd63..66722ab2f 100644
--- a/src/view/com/composer/Composer.tsx
+++ b/src/view/com/composer/Composer.tsx
@@ -84,16 +84,6 @@ export const ComposePost = observer(function ComposePost({
     [insets, isKeyboardVisible],
   )
 
-  // HACK
-  // there's a bug with @mattermost/react-native-paste-input where if the input
-  // is focused during unmount, an exception will throw (seems that a blur method isn't implemented)
-  // manually blurring before closing gets around that
-  // -prf
-  const hackfixOnClose = useCallback(() => {
-    textInput.current?.blur()
-    onClose()
-  }, [textInput, onClose])
-
   const onPressCancel = useCallback(() => {
     if (graphemeLength > 0 || !gallery.isEmpty) {
       if (store.shell.activeModals.some(modal => modal.name === 'confirm')) {
@@ -105,7 +95,7 @@ export const ComposePost = observer(function ComposePost({
       store.shell.openModal({
         name: 'confirm',
         title: 'Discard draft',
-        onPressConfirm: hackfixOnClose,
+        onPressConfirm: onClose,
         onPressCancel: () => {
           store.shell.closeModal()
         },
@@ -114,9 +104,9 @@ export const ComposePost = observer(function ComposePost({
         confirmBtnStyle: {backgroundColor: colors.red4},
       })
     } else {
-      hackfixOnClose()
+      onClose()
     }
-  }, [store, hackfixOnClose, graphemeLength, gallery])
+  }, [store, onClose, graphemeLength, gallery])
 
   // initial setup
   useEffect(() => {
@@ -205,7 +195,7 @@ export const ComposePost = observer(function ComposePost({
         await store.me.mainFeed.addPostToTop(createdPost.uri)
       }
       onPost?.()
-      hackfixOnClose()
+      onClose()
       Toast.show(`Your ${replyTo ? 'reply' : 'post'} has been published`)
     },
     [
@@ -215,7 +205,7 @@ export const ComposePost = observer(function ComposePost({
       replyTo,
       autocompleteView.knownHandles,
       extLink,
-      hackfixOnClose,
+      onClose,
       onPost,
       quote,
       setExtLink,