close keyboard before opening modal (#5124)

zio/stable
Samuel Newman 2024-09-03 23:13:25 +01:00 committed by GitHub
parent 3ee5ef32d9
commit 39f74ced5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -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>}