From 39f74ced5c81bb103a87cd39b0f1dae955dbb31d Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 3 Sep 2024 23:13:25 +0100 Subject: [PATCH] close keyboard before opening modal (#5124) --- src/view/com/composer/videos/SubtitleDialog.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/view/com/composer/videos/SubtitleDialog.tsx b/src/view/com/composer/videos/SubtitleDialog.tsx index 90a29b25..9cd8eae4 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() + }}> {isWeb ? Captions & alt text : Alt text}