From 4bcd7d8d6b5793cb6dbc46a388f0beea1567cd61 Mon Sep 17 00:00:00 2001 From: GCyganek Date: Fri, 10 Apr 2026 18:30:33 +0200 Subject: [PATCH 1/2] Fix Page scrolls to the top after switching to landscape mode & entering number --- src/components/NumberWithSymbolForm.tsx | 61 +++++++++++++++++++ .../implementation/index.native.tsx | 5 +- .../TextInput/BaseTextInput/types.ts | 3 + src/components/TextInputWithSymbol/types.ts | 1 + src/styles/index.ts | 4 ++ 5 files changed, 72 insertions(+), 2 deletions(-) diff --git a/src/components/NumberWithSymbolForm.tsx b/src/components/NumberWithSymbolForm.tsx index 92e0ff380c3c..77213f81aa61 100644 --- a/src/components/NumberWithSymbolForm.tsx +++ b/src/components/NumberWithSymbolForm.tsx @@ -3,6 +3,7 @@ import type {ForwardedRef} from 'react'; import React, {useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; import type {KeyboardTypeOptions, NativeSyntheticEvent} from 'react-native'; import {View} from 'react-native'; +import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; import useLocalize from '@hooks/useLocalize'; import {useMouseActions} from '@hooks/useMouseContext'; @@ -176,6 +177,7 @@ function NumberWithSymbolForm({ ...props }: NumberWithSymbolFormProps) { const icons = useMemoizedLazyExpensifyIcons(['DownArrow', 'PlusMinus']); + const isInLandscapeMode = useIsInLandscapeMode(); const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); @@ -546,9 +548,68 @@ function NumberWithSymbolForm({ onFocus={props.onFocus} accessibilityLabel={props.accessibilityLabel} keyboardType={props.keyboardType} + shouldAllowFocusInLandscapeMode /> ); + if (isInLandscapeMode) { + return ( + <> + + + {textInputComponent} + + {isSymbolPressable && ( +