Skip to content

Commit

Permalink
Merge pull request #27613 from neg-0/main
Browse files Browse the repository at this point in the history
Fix: portion of text shown when changing IOU value
  • Loading branch information
mountiny authored Sep 25, 2023
2 parents f068ef1 + ccc8175 commit 284c170
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import isInputAutoFilled from '../../libs/isInputAutoFilled';
import PressableWithoutFeedback from '../Pressable/PressableWithoutFeedback';
import withLocalize from '../withLocalize';
import useNativeDriver from '../../libs/useNativeDriver';
import * as Browser from '../../libs/Browser';

function BaseTextInput(props) {
const inputValue = props.value || props.defaultValue || '';
Expand Down Expand Up @@ -382,11 +383,17 @@ function BaseTextInput(props) {
This Text component is intentionally positioned out of the screen.
*/}
{(props.autoGrow || props.autoGrowHeight) && (
// Add +2 to width so that the first digit of amount do not cut off on mWeb - https://github.com/Expensify/App/issues/8158.
// Add +2 to width on Safari browsers so that text is not cut off due to the cursor or when changing the value
// https://github.com/Expensify/App/issues/8158
// https://github.com/Expensify/App/issues/26628
<Text
style={[...props.inputStyle, props.autoGrowHeight && styles.autoGrowHeightHiddenInput(width, maxHeight), styles.hiddenElementOutsideOfWindow, styles.visibilityHidden]}
onLayout={(e) => {
setTextInputWidth(e.nativeEvent.layout.width + 2);
let additionalWidth = 0;
if (Browser.isMobileSafari() || Browser.isSafari()) {
additionalWidth = 2;
}
setTextInputWidth(e.nativeEvent.layout.width + additionalWidth);
setTextInputHeight(e.nativeEvent.layout.height);
}}
>
Expand Down

0 comments on commit 284c170

Please sign in to comment.