diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-08-11 08:50:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 08:50:24 -0700 |
commit | 993026cbc41e6222af7b00da2709fda870badbe6 (patch) | |
tree | c3557db285da929bbd2f9daf901a3bf45c84ee4c /src | |
parent | 821b9ba6e695e727578d4572fc2605bd97839e74 (diff) | |
download | voidsky-993026cbc41e6222af7b00da2709fda870badbe6.tar.zst |
Fix: close keyboard when viewing the self-label modal (#1153)
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/composer/labels/LabelsBtn.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/view/com/composer/labels/LabelsBtn.tsx b/src/view/com/composer/labels/LabelsBtn.tsx index f41dd2600..1abcbe036 100644 --- a/src/view/com/composer/labels/LabelsBtn.tsx +++ b/src/view/com/composer/labels/LabelsBtn.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {StyleSheet} from 'react-native' +import {Keyboard, StyleSheet} from 'react-native' import {observer} from 'mobx-react-lite' import {Button} from 'view/com/util/forms/Button' import {usePalette} from 'lib/hooks/usePalette' @@ -7,6 +7,7 @@ import {useStores} from 'state/index' import {ShieldExclamation} from 'lib/icons' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {FontAwesomeIconStyle} from '@fortawesome/react-native-fontawesome' +import {isNative} from 'platform/detection' export const LabelsBtn = observer(function LabelsBtn({ labels, @@ -25,9 +26,14 @@ export const LabelsBtn = observer(function LabelsBtn({ style={styles.button} accessibilityLabel="Content warnings" accessibilityHint="" - onPress={() => + onPress={() => { + if (isNative) { + if (Keyboard.isVisible()) { + Keyboard.dismiss() + } + } store.shell.openModal({name: 'self-label', labels, onChange}) - }> + }}> <ShieldExclamation style={pal.link} size={26} /> {labels.length > 0 ? ( <FontAwesomeIcon |