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

Tweak FilledTextInput spacing #4716

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Tweak FilledTextInput spacing #4716

merged 1 commit into from
Jan 18, 2024

Conversation

paullinator
Copy link
Member

@paullinator paullinator commented Jan 16, 2024

Also add more test cases to InputTester

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@paullinator
Copy link
Member Author

Screenshot 2024-01-16 at 10 19 48

@paullinator paullinator force-pushed the paul/fixTextInput branch 3 times, most recently from 7e548e0 to e604f3a Compare January 17, 2024 00:51
Copy link
Contributor

@samholmes samholmes left a 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?).

src/components/themed/FilledTextInput.tsx Show resolved Hide resolved
src/components/themed/FilledTextInput.tsx Show resolved Hide resolved
src/components/themed/FilledTextInput.tsx Show resolved Hide resolved
src/components/themed/FilledTextInput.tsx Outdated Show resolved Hide resolved
src/components/themed/FilledTextInput.tsx Outdated Show resolved Hide resolved
src/components/themed/FilledTextInput.tsx Outdated Show resolved Hide resolved
src/components/themed/FilledTextInput.tsx Show resolved Hide resolved
@paullinator paullinator force-pushed the paul/fixTextInput branch 2 times, most recently from d4065e0 to b40370e Compare January 18, 2024 01:43
@paullinator
Copy link
Member Author

Screenshot 2024-01-17 at 17 38 42

@paullinator
Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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

Copy link
Member Author

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}>
Copy link
Contributor

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.

Copy link
Member Author

@paullinator paullinator Jan 18, 2024

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

Copy link
Contributor

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.

@paullinator
Copy link
Member Author

/rebase

Also add more test cases to InputTester
@paullinator paullinator disabled auto-merge January 18, 2024 21:28
@paullinator paullinator merged commit b58d744 into develop Jan 18, 2024
1 of 2 checks passed
@paullinator paullinator deleted the paul/fixTextInput branch January 18, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants