Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename style container for the TextInput #33221

Merged
merged 6 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/AmountTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const propTypes = {
style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),

/** Style for the container */
containerStyles: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),
touchableInputWrapperStyle: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),

/** Function to call to handle key presses in the text input */
onKeyPress: PropTypes.func,
Expand All @@ -44,7 +44,7 @@ const defaultProps = {
onSelectionChange: () => {},
onKeyPress: () => {},
style: {},
containerStyles: {},
touchableInputWrapperStyle: {},
};

function AmountTextInput(props) {
Expand All @@ -67,7 +67,7 @@ function AmountTextInput(props) {
onSelectionChange={props.onSelectionChange}
role={CONST.ROLE.PRESENTATION}
onKeyPress={props.onKeyPress}
containerStyles={[...StyleUtils.parseStyleAsArray(props.containerStyles)]}
touchableInputWrapperStyle={props.touchableInputWrapperStyle}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const propTypes = {
/** Customize the TextInput container */
textInputContainerStyles: PropTypes.arrayOf(PropTypes.object),

/** Customizes the touchable wrapper of the TextInput component */
touchableInputWrapperStyle: PropTypes.arrayOf(PropTypes.object),

/** Customize the main container */
containerStyles: PropTypes.arrayOf(PropTypes.object),

Expand Down
3 changes: 2 additions & 1 deletion src/components/TextInput/BaseTextInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function BaseTextInput(
errorText = '',
icon = null,
textInputContainerStyles,
touchableInputWrapperStyle,
containerStyles,
inputStyle,
forceActiveLabel = false,
Expand Down Expand Up @@ -286,7 +287,7 @@ function BaseTextInput(
style={[
autoGrowHeight && styles.autoGrowHeightInputContainer(textInputHeight, variables.componentSizeLarge, typeof maxHeight === 'number' ? maxHeight : 0),
!isMultiline && styles.componentHeightLarge,
containerStyles,
touchableInputWrapperStyle,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to copy the changes in native file, which caused #34136

]}
>
<View
Expand Down
3 changes: 3 additions & 0 deletions src/components/TextInput/BaseTextInput/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ type CustomBaseTextInputProps = {
/** Customize the TextInput container */
textInputContainerStyles?: StyleProp<ViewStyle>;

/** Customizes the touchable wrapper of the TextInput component */
touchableInputWrapperStyle?: StyleProp<ViewStyle>;

/** Customize the main container */
containerStyles?: StyleProp<ViewStyle>;

Expand Down
4 changes: 2 additions & 2 deletions src/components/TimePicker/TimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function TimePicker({forwardedRef, defaultValue, onSubmit, onInputChange}) {
setSelectionHour(e.nativeEvent.selection);
}}
style={styles.timePickerInput}
containerStyles={[styles.timePickerHeight100]}
touchableInputWrapperStyle={styles.timePickerHeight100}
selection={selectionHour}
showSoftInputOnFocus={false}
/>
Expand All @@ -411,7 +411,7 @@ function TimePicker({forwardedRef, defaultValue, onSubmit, onInputChange}) {
setSelectionMinute(e.nativeEvent.selection);
}}
style={styles.timePickerInput}
containerStyles={[styles.timePickerHeight100]}
touchableInputWrapperStyle={styles.timePickerHeight100}
selection={selectionMinute}
showSoftInputOnFocus={false}
/>
Expand Down
Loading