-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Revert remove hint #8232
Revert remove hint #8232
Conversation
@mountiny I'm sorry for approving the regression. I hope this fixes it. |
@rushatgabhane I think this should be QA'ed. |
@parasharrajat |
Co-authored-by: Rajat Parashar <parasharrajat@users.noreply.github.com>
Yeah. Hopefully, the fix is not far away. Let's add QA steps to test it in the storybook and we can wait for the storybook to be fixed. How does that sound? This way QA will come to know about this feature. |
Sure, sounds good. I'll add the QA steps once the storybook bug is fixed |
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.
@rushatgabhane Thanks for fixing this!
Can you please link where the Storybook bug is being worked on?
Storybook bug - #8179 (no PR for it yet) |
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 looks good to me once the storybook QA is added. It looks like the PR has been merged now.
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.
@rushatgabhane The Storybook fix has been merged #8265 🎉 feel free to update the steps 🙌 thanks!
wohoo! QA steps and tests have been updated. |
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.
LGTM! @parasharrajat any thoughts here?
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.
Yup. As we are not showing the counter anymore, you should move the value prop from state to class property.
@parasharrajat I pushed code which moves But are we sure that we wanna do this? The way we've designed Because we're returning early in App/src/components/TextInput/BaseTextInput.js Lines 63 to 67 in 6e9d429
Screen.Recording.2022-03-24.at.9.11.40.AM.mov |
cc: @sig5 does moving |
Oh, ok. May be directly update the width for autoGrow without depending on componentDidUpdate |
@@ -127,13 +124,13 @@ class BaseTextInput extends Component { | |||
if (this.props.onInputChange) { | |||
this.props.onInputChange(value); | |||
} | |||
this.setState({value}); | |||
this.value = value; |
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.
May be directly update the width for autoGrow without depending on componentDidUpdate
We always have the correct value which is set by callback for onChangeText()
.
cont below..
@@ -301,7 +302,7 @@ class BaseTextInput extends Component { | |||
style={[...this.props.inputStyle, styles.hiddenElementOutsideOfWindow, styles.visibilityHidden]} | |||
onLayout={e => this.setState({textInputWidth: e.nativeEvent.layout.width})} | |||
> | |||
{this.state.value || this.props.placeholder} | |||
{this.value || this.props.placeholder} |
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.
But the updated value
isn't reflected when calculating the width, because no re-renders happen on typing something in the input (which is a good thing).
This can only be solved by converting value
to a state of the component.
Ok. I see. Yup, I am fine with value in the state. You can revert those commits. |
@@ -30,7 +29,6 @@ class BaseTextInput extends Component { | |||
passwordHidden: props.secureTextEntry, | |||
textInputWidth: 0, | |||
prefixWidth: 0, | |||
value, |
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.
Add a comment here that says keep value in state for the AutoGrow feature to work.
Thanks @sig5, we're safe to move value back to state now. Commits reverted, and ready for review! |
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.
Not tested. but LGTM.
…fy-App into revert-remove-hint
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 looks good and the storybook tests work well.
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.
Thanks for doing this follow-up @rushatgabhane and thanks for the review @parasharrajat and @neil-marcellini Going to merge now 🎉
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @roryabraham in version: 1.1.49-1 🚀
|
Details
In PR #8145,
hint
feature was removed by mistake.This PR adds back the
hint
feature.Thanks to @parasharrajat for pointing this out here - #8044 (comment)
Fixed Issues
$ #8044
Tests
Test 1
npm run storybook
Oops!
in the input.Oops!
from the input.Test 2
Currently, we don't use
hint
prop ofTextInput
anywhere.So the following steps are a workaround to test this PR.
/src/pages/settings/Payments/AddDebitCardPage.js
hint
prop to any text inputPR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectionsrc/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
property(i.e.
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectionsrc/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
property(i.e.
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)QA Steps
Oops!
in the input.Oops!
from the input.Screenshots
Web
Screen.Recording.2022-03-19.at.3.02.05.AM.mov
Mobile Web
Screen.Recording.2022-03-19.at.2.30.08.AM.mov
Desktop
Screen.Recording.2022-03-19.at.2.17.58.AM.mov
iOS
Screen.Recording.2022-03-19.at.2.27.53.AM.mov
Android
screen-20220319-024324.mp4