Dismiss keyboard when closing dialog (#3053)
parent
39d324ab8b
commit
04d4c9779f
|
@ -1,5 +1,5 @@
|
||||||
import React, {useImperativeHandle} from 'react'
|
import React, {useImperativeHandle} from 'react'
|
||||||
import {View, Dimensions} from 'react-native'
|
import {View, Dimensions, Keyboard} from 'react-native'
|
||||||
import BottomSheet, {
|
import BottomSheet, {
|
||||||
BottomSheetBackdrop,
|
BottomSheetBackdrop,
|
||||||
BottomSheetScrollView,
|
BottomSheetScrollView,
|
||||||
|
@ -78,6 +78,7 @@ export function Outer({
|
||||||
const onChange = React.useCallback(
|
const onChange = React.useCallback(
|
||||||
(index: number) => {
|
(index: number) => {
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
|
Keyboard.dismiss()
|
||||||
try {
|
try {
|
||||||
closeCallback.current?.()
|
closeCallback.current?.()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
@ -190,8 +191,15 @@ export function ScrollableInner({children, style}: DialogInnerProps) {
|
||||||
|
|
||||||
export function Handle() {
|
export function Handle() {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|
||||||
|
const onTouchStart = React.useCallback(() => {
|
||||||
|
Keyboard.dismiss()
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[a.absolute, a.w_full, a.align_center, a.z_10, {height: 40}]}>
|
<View
|
||||||
|
style={[a.absolute, a.w_full, a.align_center, a.z_10, {height: 40}]}
|
||||||
|
onTouchStart={onTouchStart}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.rounded_sm,
|
a.rounded_sm,
|
||||||
|
|
Loading…
Reference in New Issue