-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Adds background to label #5959
Adds background to label #5959
Conversation
I will review it shortly. There are issues with this change.
|
@parasharrajat I change the gap between the label and value.. this is what you mean right?, let me know if this gap is correct so I can push this change. Actual gapAcutal.gap.movNew gapNew.gap.movAbout the text seen on the right end, I can't reproduce this issue, could you tell me in which platform or in which input did you got this issue ?? |
I will test it thoroughly and Let you know. |
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.
I don't completely agree with the approach here but as this is currently blocking the deployment so we can go for it.
labelScale={this.state.labelScale} | ||
/> | ||
<> | ||
{multiline ? ( |
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.
I don't feel good about this change but let's drop a comment here why we need this for multiline only and what it does.
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.
Also rather than ternary let's use this syntax:
{multiline && <View style={styles.expensiTextInputLabelBackground} />}
src/styles/styles.js
Outdated
position: 'absolute', | ||
top: 0, | ||
width: '100%', | ||
height: 28, |
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.
shouldn't this be the padding-top of the 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.
You're right, I will change it to the same value as paddingTop
from the TextInput
@@ -550,6 +559,7 @@ const styles = { | |||
paddingBottom: 8, | |||
paddingHorizontal: 11.5, | |||
borderRadius: variables.componentBorderRadiusNormal, | |||
zIndex: -1, |
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.
Please test it and it should not have any regressions.
Please upload screenshots for all platforms showcasing single line and multiline input, highlighted and non highlighted. |
cc: @roryabraham this is the solution we are tending towards #5924 . |
@parasharrajat I kept testing those edges on the right, I believe that are the scrolling bar style.. I managed to see it when changing the computer configuration, see attached video. Could that be it ?? Screen.Recording.2021-10-20.at.12.41.04.mov |
Yup. that one. Use overflow: hidden on the wrapper view and this will be gone for good. |
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.
Overall approach seems fine to me - still need to test before I'll approve.
labelScale={this.state.labelScale} | ||
/> | ||
<> | ||
{multiline ? ( |
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.
Also rather than ternary let's use this syntax:
{multiline && <View style={styles.expensiTextInputLabelBackground} />}
Going to add the |
|
I already made the required changes, also updated the videos with this changes for all platforms. I couldn't find an autofill input with multiline. |
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.
<> | ||
{/* Adding this background to the label only for multiline text input, | ||
to prevent text overlaping with label when scrolling */} | ||
{multiline && <View style={styles.expensiTextInputLabelBackground} />} |
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.
Am I correct in thinking that the only reason we don't add this view for single-line inputs is because of the effect it causes when an input is auto-filled? Did you see or investigate this comment?
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, it is only set to multiline to avoid seeing the white background when it isn't multiline and it has autofill. And it look all the container blue(or whatever the color set depending on the browser).
I did investigate on it but there are some points to consider when trying to change the background set by the browser.
See #5704 (comment)
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.
Okay, well I don't think we need to worry too much about the styles applied by the browser's auto-fill, so this is probably okay for now.
Yes @roryabraham , initially I set the |
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.
Okay, I think we are good here.
(cherry picked from commit 04e2d12)
🚀 Cherry-picked to staging by @roryabraham in version: 1.1.8-6 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
@roryabraham Was QAing this on Android but I don't have the same "Manage Members" as in the testing screenshots |
@roryabraham We see build 1.1.8-8 on iOS 🎉 🎉 We tested this and it was a pass too (same behaviour as in iOS) |
🚀 Deployed to production by @roryabraham in version: 1.1.8-9 🚀
|
🚀 Deployed to staging by @roryabraham in version: 1.1.8-10 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.10-2 🚀
|
@parasharrajat
Details
Adds a background to the label, to avoid overlapping text when
TextInput
is multiline.Added
zIndex
-1 to theTextInput
, because is needed iniOS
if this isn't set, the text still overlaps.Fixed Issues
$ #4515
$ #5704
Tests
TextInput
.TextInput
with autofill enabled and multiline. (Label background should be white)QA Steps
TextInput
.TextInput
with autofill enabled and multiline. (Label background should be white)Tested On
Screenshots
Web
web.mov
Desktop
Desktop.mov
iOS
iOS.mp4
Android
Android.mov