Skip to content

Commit 021b8ea

Browse files
arosiclairOSBotify
authored andcommitted
Merge pull request #78903 from situchan/revert-77324-fix/76785
Revert "Report field - Multiline input for name field in report field does not scroll" (cherry picked from commit 0a2c794) (cherry-picked to staging by arosiclair)
1 parent edf5f5d commit 021b8ea

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

src/components/TextInput/BaseTextInput/implementation/index.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import useMarkdownStyle from '@hooks/useMarkdownStyle';
2727
import useStyleUtils from '@hooks/useStyleUtils';
2828
import useTheme from '@hooks/useTheme';
2929
import useThemeStyles from '@hooks/useThemeStyles';
30-
import {isMobileChrome, isMobileSafari, isSafari} from '@libs/Browser';
30+
import {isMobileChrome} from '@libs/Browser';
3131
import {scrollToRight} from '@libs/InputUtils';
3232
import isInputAutoFilled from '@libs/isInputAutoFilled';
3333
import variables from '@styles/variables';
@@ -257,27 +257,6 @@ function BaseTextInput({
257257
}
258258
};
259259

260-
/**
261-
* Forces Safari to recalculate text layout when input height changes.
262-
* Safari's Shadow DOM doesn't reflow text automatically when container height
263-
* changes, causing text to remain stuck on the previous number of lines.
264-
* https://github.com/Expensify/App/issues/76785
265-
*/
266-
useEffect(() => {
267-
if (!input.current || !(isSafari() || isMobileSafari()) || textInputHeight === 0) {
268-
return;
269-
}
270-
271-
const element = input.current;
272-
const originalWhiteSpace = element.style.whiteSpace;
273-
274-
element.style.whiteSpace = 'nowrap';
275-
// Force layout calculation on the next frame
276-
requestAnimationFrame(() => {
277-
element.style.whiteSpace = originalWhiteSpace || '';
278-
});
279-
}, [textInputHeight]);
280-
281260
const togglePasswordVisibility = useCallback(() => {
282261
setPasswordHidden((prevPasswordHidden: boolean | undefined) => !prevPasswordHidden);
283262
}, []);

src/components/TextInput/TextInputMeasurement/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ function TextInputMeasurement({
6363
style={[
6464
inputStyle,
6565
autoGrowHeight && styles.autoGrowHeightHiddenInput(width ?? 0, typeof maxAutoGrowHeight === 'number' ? maxAutoGrowHeight : undefined),
66-
// Since the hidden input is absolutely positioned, container styles don't automatically apply.
67-
// We pass the container styles directly to match the visible input's dimensions.
68-
styles.hiddenTextInputContainer,
6966
styles.hiddenElementOutsideOfWindow,
7067
styles.visibilityHidden,
7168
]}

src/styles/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,12 +1251,6 @@ const staticStyles = (theme: ThemeColors) =>
12511251
borderColor: theme.border,
12521252
},
12531253

1254-
hiddenTextInputContainer: {
1255-
paddingLeft: 8,
1256-
paddingRight: 8,
1257-
borderWidth: 1,
1258-
},
1259-
12601254
cannotBeEditedSplitInputContainer: {
12611255
flexDirection: 'row',
12621256
alignItems: 'center',

0 commit comments

Comments
 (0)