diff --git a/src/components/TextPicker/TextSelectorModal.tsx b/src/components/TextPicker/TextSelectorModal.tsx index 34f5c9b6c9313..a4fce609f77bd 100644 --- a/src/components/TextPicker/TextSelectorModal.tsx +++ b/src/components/TextPicker/TextSelectorModal.tsx @@ -41,6 +41,7 @@ function TextSelectorModal({ const {shouldUseNarrowLayout} = useResponsiveLayout(); const [currentValue, setValue] = useState(value); + const [isClosing, setIsClosing] = useState(false); const inputRef = useRef(null); const inputValueRef = useRef(value); @@ -50,6 +51,7 @@ function TextSelectorModal({ }; const hide = useCallback(() => { + setIsClosing(true); onClose(); if (shouldClearOnClose) { setValue(''); @@ -86,6 +88,7 @@ function TextSelectorModal({ return; } setValue(value); + setIsClosing(false); // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [isVisible]); @@ -161,6 +164,7 @@ function TextSelectorModal({ addBottomSafeAreaPadding enterKeyEventListenerPriority={0} allowHTML={allowHTML} + shouldValidateOnBlur={!isClosing} > {!!subtitle && ( diff --git a/src/utils/keyboard/index.android.ts b/src/utils/keyboard/index.android.ts index b421de20d138d..45ea1755ad6d5 100644 --- a/src/utils/keyboard/index.android.ts +++ b/src/utils/keyboard/index.android.ts @@ -1,4 +1,4 @@ -import {Keyboard, Platform} from 'react-native'; +import {Keyboard} from 'react-native'; import {KeyboardEvents} from 'react-native-keyboard-controller'; type SimplifiedKeyboardEvent = { @@ -39,9 +39,7 @@ const dismiss = (): Promise => { const dismissKeyboardAndExecute = (cb: () => void): Promise => { return new Promise((resolve) => { - // This fixes a bug specific to Android < 16 (Platform.Version < 36) - // https://github.com/Expensify/App/issues/70692 - if (!isVisible || Number(Platform.Version) >= 36) { + if (!isVisible) { cb(); resolve(); return;