Skip to content

Commit 66a84ca

Browse files
committed
fix: autogrow heigh for TextInput
1 parent 455570f commit 66a84ca

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

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

+3-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import useMarkdownStyle from '@hooks/useMarkdownStyle';
2525
import useStyleUtils from '@hooks/useStyleUtils';
2626
import useTheme from '@hooks/useTheme';
2727
import useThemeStyles from '@hooks/useThemeStyles';
28-
import getPlatform from '@libs/getPlatform';
2928
import isInputAutoFilled from '@libs/isInputAutoFilled';
3029
import variables from '@styles/variables';
3130
import CONST from '@src/CONST';
@@ -80,10 +79,6 @@ function BaseTextInput(
8079
}: BaseTextInputProps,
8180
ref: ForwardedRef<BaseTextInputRef>,
8281
) {
83-
// For iOS, we don't need to measure the text input because it already has auto grow behavior
84-
// See TextInputMeasurement.ios.tsx for more details
85-
const isExternalAutoGrowMeasurement = getPlatform() !== CONST.PLATFORM.IOS && autoGrow;
86-
8782
const InputComponent = InputComponentMap.get(type) ?? RNTextInput;
8883
const isMarkdownEnabled = type === 'markdown';
8984
const isAutoGrowHeightMarkdown = isMarkdownEnabled && autoGrowHeight;
@@ -253,7 +248,7 @@ function BaseTextInput(
253248
styles.textInputContainer,
254249
textInputContainerStyles,
255250
!!contentWidth && StyleUtils.getWidthStyle(textInputWidth),
256-
isExternalAutoGrowMeasurement && StyleUtils.getAutoGrowWidthInputContainerStyles(textInputWidth, autoGrowExtraSpace),
251+
autoGrow && StyleUtils.getAutoGrowWidthInputContainerStyles(textInputWidth, autoGrowExtraSpace),
257252
!hideFocusedState && isFocused && styles.borderColorFocus,
258253
(!!hasError || !!errorText) && styles.borderColorDanger,
259254
autoGrowHeight && {scrollPaddingTop: typeof maxAutoGrowHeight === 'number' ? 2 * maxAutoGrowHeight : undefined},
@@ -352,8 +347,8 @@ function BaseTextInput(
352347
placeholderTextColor={placeholderTextColor ?? theme.placeholderText}
353348
underlineColorAndroid="transparent"
354349
style={[
355-
!autoGrow && styles.flex1,
356-
!autoGrow && styles.w100,
350+
styles.flex1,
351+
styles.w100,
357352
inputStyle,
358353
(!hasLabel || isMultiline) && styles.pv0,
359354
inputPaddingLeft,

src/components/TextInput/TextInputMeasurement/index.ios.tsx

-7
This file was deleted.

0 commit comments

Comments
 (0)