-
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
fix(#22204): Toggle label correctly #24199
fix(#22204): Toggle label correctly #24199
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewing 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.
@hannojg I checked and the code is fixing the current issue. Will do couple more testing to see if it causes any regression. Meanwhile could you check on the minor comments posted.
activateLabel(); | ||
} else if (!hasValueRef.current && !isFocused) { | ||
deactivateLabel(); | ||
if (props.value === undefined || props.value > 0) { |
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.
We can use underscore functions to combine both check into one
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.
@hannojg Can you kindly check on this minor comment?
} | ||
// The ref is needed when the component is uncontrolled and we don't have a value prop | ||
const hasValueRef = useRef(initialValue.length > 0); | ||
const inputValue = props.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.
what is the difference between initialValue
and inputValue
and their purpose? Unable to understand clearly.
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.
initialValue
is the value that we have when the component got created for the first time.
inputValue
is the value prop but with the fallback to an empty string (instead of undefined)
I tested it and found no errors. Lgtm :) |
Hi @hannojg Can you check on the minor comment above and fix merge conflicts? |
@abdulrahuman5196 all updated 😊 |
Ah whoops, please hold on, the last commit implements a wrong logic |
@abdulrahuman5196 okay please check again now! Note: I don't see how the if statement could be composed into one |
@hannojg Sorry for my delay here. Meanwhile we also had merge freeze so paused sometime on PR since anyways we would end up doing a re-test after merge freeze. Could you kindly do a merge from main as suggested here https://expensify.slack.com/archives/C01GTK53T8Q/p1694405959277169 and resolve conflicts as well? |
Gentle ping @hannojg |
@hannojg Gentle bump |
@abdulrahuman5196 Resolved the conflicts, can you please test again? Thank you |
Reviewing now |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-27.at.3.01.53.PM.mp4Mobile Web - Chromeaz_recorder_20230927_151149.mp4Mobile Web - SafariScreen.Recording.2023-09-27.at.3.05.41.PM.mp4DesktopScreen.Recording.2023-09-27.at.3.24.30.PM.mp4iOSScreen.Recording.2023-09-27.at.3.16.25.PM.mp4AndroidScreen.Recording.2023-09-27.at.3.17.27.PM.mp4 |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @hayata-suenaga
🎀 👀 🎀
C+ Reviewed
@hannojg Unit tests are failing in main. https://expensify.slack.com/archives/C01GTK53T8Q/p1695796810686659 Kindly merge from main a little while after and we should be good to merge this PR |
…/22204-task-desc-stays-on-top
@abdulrahuman5196 updated again with main, I think we are good now? |
@hannojg Another Unit test is failing. I don't think its related to this PR as well 😢 |
please merge main. that should fix the test failures |
ping @hannojg |
…b.com:margelo/expensify-app-fork into fix/22204-task-desc-stays-on-top
@abdulrahuman5196 Updated! |
All checks are now passing @hayata-suenaga |
✋ 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 staging by https://github.com/hayata-suenaga in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.77-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.77-7 🚀
|
Details
A recent change to our input component introduced a bug where the label of the input wouldn't activate under some circumstances. This PR fixes this issue.
Fixed Issues
$ #22204
PROPOSAL: #22204 (comment)
Tests
Offline tests
n/a
QA Steps
Same as testing
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-08-07.at.08.30.34.mov
Mobile Web - Chrome
Screen.Recording.2023-08-07.at.08.43.04.mov
Mobile Web - Safari
mWeb-Safari.mp4
Desktop
Screen.Recording.2023-08-07.at.08.40.49.mov
iOS
ios.mp4
Android