Skip to content

Commit

Permalink
Merge pull request #31777 from dukenv0307/fix/31197
Browse files Browse the repository at this point in the history
Add verticalAlignTop when input has autoGrowHeight to base input component
  • Loading branch information
aldo-expensify authored Dec 4, 2023
2 parents 299721b + aa703f2 commit 84aa647
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/components/TextInput/BaseTextInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ function BaseTextInput(props) {
!isMultiline && Browser.isMobileChrome() && {boxSizing: 'content-box', height: undefined},

// Stop scrollbar flashing when breaking lines with autoGrowHeight enabled.
props.autoGrowHeight && StyleUtils.getAutoGrowHeightInputStyle(styles, textInputHeight, maxHeight),
...(props.autoGrowHeight ? [StyleUtils.getAutoGrowHeightInputStyle(styles, textInputHeight, maxHeight), styles.verticalAlignTop] : []),

// Add disabled color theme when field is not editable.
props.disabled && styles.textInputDisabled,
styles.pointerEventsAuto,
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInput/BaseTextInput/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function BaseTextInput(props) {
!isMultiline && {height, lineHeight: undefined},

// Stop scrollbar flashing when breaking lines with autoGrowHeight enabled.
props.autoGrowHeight && StyleUtils.getAutoGrowHeightInputStyle(styles, textInputHeight, maxHeight),
...(props.autoGrowHeight ? [StyleUtils.getAutoGrowHeightInputStyle(styles, textInputHeight, maxHeight), styles.verticalAlignTop] : []),
// Add disabled color theme when field is not editable.
props.disabled && styles.textInputDisabled,
styles.pointerEventsAuto,
Expand Down
1 change: 0 additions & 1 deletion src/pages/EditRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) {
}}
autoGrowHeight
containerStyles={[styles.autoGrowHeightMultilineInput]}
inputStyle={[styles.verticalAlignTop]}
submitOnEnter={!Browser.isMobile()}
/>
</View>
Expand Down
1 change: 0 additions & 1 deletion src/pages/ReportWelcomeMessagePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ function ReportWelcomeMessagePage(props) {
value={welcomeMessage}
onChangeText={handleWelcomeMessageChange}
autoCapitalize="none"
inputStyle={[styles.verticalAlignTop]}
containerStyles={[styles.autoGrowHeightMultilineInput]}
/>
</View>
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/MoneyRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) {
}}
autoGrowHeight
containerStyles={[styles.autoGrowHeightMultilineInput]}
inputStyle={[styles.verticalAlignTop]}
submitOnEnter={!Browser.isMobile()}
/>
</View>
Expand Down
1 change: 0 additions & 1 deletion src/pages/settings/Security/CloseAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function CloseAccountPage(props) {
label={props.translate('closeAccountPage.enterMessageHere')}
aria-label={props.translate('closeAccountPage.enterMessageHere')}
role={CONST.ACCESSIBILITY_ROLE.TEXT}
inputStyle={[styles.verticalAlignTop]}
containerStyles={[styles.mt5, styles.autoGrowHeightMultilineInput]}
/>
<Text style={[styles.mt5]}>
Expand Down
1 change: 0 additions & 1 deletion src/pages/tasks/NewTaskDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function NewTaskDescriptionPage(props) {
autoGrowHeight
submitOnEnter={!Browser.isMobile()}
containerStyles={[styles.autoGrowHeightMultilineInput]}
inputStyle={[styles.verticalAlignTop]}
/>
</View>
</FormProvider>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/tasks/NewTaskDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ function NewTaskDetailsPage(props) {
autoGrowHeight
submitOnEnter={!Browser.isMobile()}
containerStyles={[styles.autoGrowHeightMultilineInput]}
textAlignVertical="top"
defaultValue={parser.htmlToMarkdown(parser.replace(taskDescription))}
inputStyle={[styles.verticalAlignTop]}
value={taskDescription}
onValueChange={(value) => setTaskDescription(value)}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/tasks/TaskDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ function TaskDescriptionPage(props) {
autoGrowHeight
submitOnEnter={!Browser.isMobile()}
containerStyles={[styles.autoGrowHeightMultilineInput]}
inputStyle={[styles.verticalAlignTop]}
/>
</View>
</FormProvider>
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspaceInviteMessagePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class WorkspaceInviteMessagePage extends React.Component {
autoCompleteType="off"
autoCorrect={false}
autoGrowHeight
inputStyle={[this.props.themeStyles.verticalAlignTop]}
containerStyles={[this.props.themeStyles.autoGrowHeightMultilineInput]}
defaultValue={this.state.welcomeNote}
value={this.state.welcomeNote}
Expand Down
1 change: 0 additions & 1 deletion src/pages/workspace/WorkspaceNewRoomPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ function WorkspaceNewRoomPage(props) {
autoGrowHeight
maxLength={CONST.MAX_COMMENT_LENGTH}
autoCapitalize="none"
textAlignVertical="top"
containerStyles={[styles.autoGrowHeightMultilineInput]}
/>
</View>
Expand Down

0 comments on commit 84aa647

Please sign in to comment.