dismiss keyboard when threadgate settings are opened (#2161)
parent
f7ec7f700e
commit
0f7dbbba4a
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {TouchableOpacity, StyleSheet} from 'react-native'
|
import {TouchableOpacity, StyleSheet, Keyboard} from 'react-native'
|
||||||
import {
|
import {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
FontAwesomeIconStyle,
|
FontAwesomeIconStyle,
|
||||||
|
@ -11,6 +11,7 @@ import {useLingui} from '@lingui/react'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useModalControls} from '#/state/modals'
|
import {useModalControls} from '#/state/modals'
|
||||||
import {ThreadgateSetting} from '#/state/queries/threadgate'
|
import {ThreadgateSetting} from '#/state/queries/threadgate'
|
||||||
|
import {isNative} from '#/platform/detection'
|
||||||
|
|
||||||
export function ThreadgateBtn({
|
export function ThreadgateBtn({
|
||||||
threadgate,
|
threadgate,
|
||||||
|
@ -26,6 +27,9 @@ export function ThreadgateBtn({
|
||||||
|
|
||||||
const onPress = () => {
|
const onPress = () => {
|
||||||
track('Composer:ThreadgateOpened')
|
track('Composer:ThreadgateOpened')
|
||||||
|
if (isNative && Keyboard.isVisible()) {
|
||||||
|
Keyboard.dismiss()
|
||||||
|
}
|
||||||
openModal({
|
openModal({
|
||||||
name: 'threadgate',
|
name: 'threadgate',
|
||||||
settings: threadgate,
|
settings: threadgate,
|
||||||
|
|
Loading…
Reference in New Issue