From 998acfd07013e0b714d4bc544ff28557ce859c39 Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Wed, 19 Mar 2025 19:42:34 +0100 Subject: [PATCH 1/2] fix: keyboard is not displayed on iOS for autofocused inputs --- src/components/TextInput/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/TextInput/index.tsx b/src/components/TextInput/index.tsx index 4070714c798e..3e046863ff99 100644 --- a/src/components/TextInput/index.tsx +++ b/src/components/TextInput/index.tsx @@ -15,6 +15,7 @@ function TextInput(props: BaseTextInputProps, ref: ForwardedRef(null); const removeVisibilityListenerRef = useRef(null); + const isAutoFocusEnabled = typeof ref === 'function' || props.autoFocus; useEffect(() => { let removeVisibilityListener = removeVisibilityListenerRef.current; @@ -57,6 +58,7 @@ function TextInput(props: BaseTextInputProps, ref: ForwardedRef { textInputRef.current = element as HTMLFormElement; From 33c630e77725e86d0df795492b791ca1d592740b Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Wed, 19 Mar 2025 20:11:18 +0100 Subject: [PATCH 2/2] ESLint changes --- src/components/TextInput/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/TextInput/index.tsx b/src/components/TextInput/index.tsx index 3e046863ff99..162f514141ae 100644 --- a/src/components/TextInput/index.tsx +++ b/src/components/TextInput/index.tsx @@ -2,7 +2,7 @@ import type {ForwardedRef} from 'react'; import React, {useEffect, useRef} from 'react'; import type {StyleProp, ViewStyle} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Browser from '@libs/Browser'; +import {isMobileChrome} from '@libs/Browser'; import DomUtils from '@libs/DomUtils'; import Visibility from '@libs/Visibility'; import BaseTextInput from './BaseTextInput'; @@ -28,7 +28,7 @@ function TextInput(props: BaseTextInputProps, ref: ForwardedRef { - if (!Browser.isMobileChrome() || !Visibility.isVisible() || !textInputRef.current || DomUtils.getActiveElement() !== textInputRef.current) { + if (!isMobileChrome() || !Visibility.isVisible() || !textInputRef.current || DomUtils.getActiveElement() !== textInputRef.current) { return; } textInputRef.current.blur();