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

add scroll padding to multiline and labeled text input #8137

Merged
merged 8 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 8 additions & 1 deletion src/components/TextInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class TextInput extends React.Component {
}

render() {
const isLabeledMultiline = Boolean(this.props.label.length) && this.props.multiline;

return (
<BaseTextInput
// eslint-disable-next-line react/jsx-props-no-spreading
Expand All @@ -33,7 +35,12 @@ class TextInput extends React.Component {

this.props.innerRef.current = el;
}}
inputStyle={[styles.baseTextInput, styles.textInputDesktop, ...this.props.inputStyle]}
inputStyle={[
styles.baseTextInput,
styles.textInputDesktop,
isLabeledMultiline && styles.textInputMultiline,
...this.props.inputStyle,
]}
/>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,10 @@ const styles = {
borderRadius: variables.componentBorderRadiusNormal,
},

textInputMultiline: {
scrollPadding: '23px 0 0 0',
mollfpr marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

@parasharrajat parasharrajat Mar 22, 2022

Choose a reason for hiding this comment

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

        scrollPadding: '23px 0 0 0 0',

I think we only need top padding. Right?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry ignore this, I am on drugs... Lol.

},

textInputAndIconContainer: {
flex: 1,
height: '100%',
Expand Down