Skip to content

Commit

Permalink
Merge pull request #8137 from mollfpr/fix-7729
Browse files Browse the repository at this point in the history
add scroll padding to multiline and labeled text input
  • Loading branch information
Julesssss authored Mar 25, 2022
2 parents c04fca7 + 880da9a commit 9c50db7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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 @@ -702,6 +702,10 @@ const styles = {
borderRadius: variables.componentBorderRadiusNormal,
},

textInputMultiline: {
scrollPadding: '23px 0 0 0',
},

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

0 comments on commit 9c50db7

Please sign in to comment.