-
Notifications
You must be signed in to change notification settings - Fork 258
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
Tweak FilledTextInput spacing #4716
Conversation
edba2f7
to
6373eed
Compare
7e548e0
to
e604f3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to my comments, the prefix is not vertically aligned with the input text from the visuals provided in the PR. This should be adjusted so that the prefix aligns with the input text just like the suffix does (should?).
d4065e0
to
b40370e
Compare
b40370e
to
468f905
Compare
Ignore blue background. That was removed in the fixup |
@@ -347,6 +345,8 @@ const InnerContainer = styled(Animated.View)<{ | |||
hasPlaceholder: boolean | |||
}>(theme => ({ hasPlaceholder, focusValue }) => { | |||
const rem = theme.rem(1) | |||
|
|||
// Need 2 pixels of shift given a 16 point rem settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still it's weird that you need to shift the container two pixels to the right on Android. Why would Android be rendering views differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant tell you why but that seems to be the case with text inputs vs text views
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an Animated.View not a TextInput
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it's the view of the TextInput
@@ -208,9 +209,9 @@ export const FilledTextInput = React.forwardRef<FilledTextInputRef, FilledTextIn | |||
const InputComponent = numeric ? StyledNumericInput : StyledAnimatedTextInput | |||
|
|||
return ( | |||
<> | |||
<View style={spaceStyle}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this done? Isn't the whole point of using the space props within the component to avoid the extra view? If this is our result, we might as well just use a component around the input when we want the space props, at least then we'd only be rendering an extra view when we actually want the space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the bug where extra margin was added by a space prop but inbetween the input box and the bottom right message. it's too late in the sprint to make a change that would break the API given how many places use this component is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case, we can just use a Space component and pass the space props directly to it. Also, override sideways to false.
/rebase |
468f905
to
75f5dfa
Compare
Also add more test cases to InputTester
75f5dfa
to
1326529
Compare
Also add more test cases to InputTester
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneRequirements
If you have made any visual changes to the GUI. Make sure you have: