From 39f74ced5c81bb103a87cd39b0f1dae955dbb31d Mon Sep 17 00:00:00 2001
From: Samuel Newman <mozzius@protonmail.com>
Date: Tue, 3 Sep 2024 23:13:25 +0100
Subject: close keyboard before opening modal (#5124)

---
 src/view/com/composer/videos/SubtitleDialog.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/view/com/composer/videos/SubtitleDialog.tsx')

diff --git a/src/view/com/composer/videos/SubtitleDialog.tsx b/src/view/com/composer/videos/SubtitleDialog.tsx
index 90a29b25d..9cd8eae47 100644
--- a/src/view/com/composer/videos/SubtitleDialog.tsx
+++ b/src/view/com/composer/videos/SubtitleDialog.tsx
@@ -1,5 +1,5 @@
 import React, {useCallback} from 'react'
-import {StyleProp, View, ViewStyle} from 'react-native'
+import {Keyboard, StyleProp, View, ViewStyle} from 'react-native'
 import RNPickerSelect from 'react-native-picker-select'
 import {msg, Trans} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
@@ -45,7 +45,10 @@ export function SubtitleDialogBtn(props: Props) {
         size="xsmall"
         color="secondary"
         variant="ghost"
-        onPress={control.open}>
+        onPress={() => {
+          if (Keyboard.isVisible()) Keyboard.dismiss()
+          control.open()
+        }}>
         <ButtonIcon icon={CCIcon} />
         <ButtonText>
           {isWeb ? <Trans>Captions & alt text</Trans> : <Trans>Alt text</Trans>}
-- 
cgit 1.4.1

