-
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
Reusable and stylable money request amount input #40390
Reusable and stylable money request amount input #40390
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@hungvu193 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] |
Please let's me know when this is ready. Thank you 😄 |
I think the PR is already ready) But I need some sleep |
Sure. Get some rests 😄 . I'll review in the mean time |
Would be good to get some screenshots too. And just to confirm that we're not messing with the defaults of the input fields but rather adding a variation? cc @youssef-lr @Expensify/design |
Hello ) |
Hello ) |
Cool. I'm AFK now but I'll review in the next couples of hour |
Is it possible to right-align the text AND the prefixed character, while allowing it to be flexible enough to grow if needed? |
I'll test it now |
@shawnborton 2024-04-18.13.20.18.movBut in any case, I think at the moment we have a very flexible input |
That does feel pretty good... can you show it using USD $, as I think that will be the mainline case? Thanks! |
here it is ) 2024-04-18.14.00.13.movI used minimum width for examples 2024-04-18.14.00.53.mov |
Let us know when this is ready for another design review! |
@shawnborton I have tested all inputs and everything looks good by default, for the split page style we can tackle those in my PR. We just need to ensure this PR is not affecting any default styles. I think let's go ahead and make another build! |
Sounds good, will build now! |
return; | ||
} | ||
const frontendAmount = amount ? CurrencyUtils.convertToFrontendAmount(amount).toString() : ''; | ||
setNewAmount(frontendAmount); |
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.
setNewAmount(frontendAmount); | |
setCurrentAmount(frontendAmount); |
We need to use setCurrentAmount
here as used previously. We shouldn't be triggering onAmountChange
from here because that's supposed to be only triggered via user input and via setNewAmount
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.
Done )
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.
Nice catch on this one 👍, I should have caught it earlier 🤦
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@shawnborton let me know how the testing goes! I haven't found any issue in my testing so I think we're very close to merge this! |
Input wise I couldn't find any issues |
This is known issue and was reported earlier by @shawnborton in this slack convo: |
Thanks for testing @dubielzyk-expensify! I'll wait to hear from @shawnborton before merging. |
Gonna start testing this shortly, will report back! |
Did some testing on iOS and couldn't seem to find anything, so I'd say this is all good on my end 👍 |
Awesome, thanks everyone!! |
✋ 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/youssef-lr in version: 1.4.65-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.65-5 🚀
|
}} | ||
selectedCurrencyCode={currency} | ||
selection={selection} | ||
onSelectionChange={(e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => { |
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.
Coming from this issue #41762 , we are encountering an edge case on Android. When we select all the number and then add a number, the cursor is misplaced and appears at the start of the number. The reason for this is that on Android, when we select all the text and add a number, the selection update from onSelectionChange is triggered earlier than the manual selection update. As a result, the prevSelection already contains the new selection, leading to an incorrect selection calculation more context on the proposal #41762 (comment)
}} | ||
selectedCurrencyCode={currency} | ||
selection={selection} | ||
onSelectionChange={(e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => { |
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.
FYI, this caused the following issue: #50886
Detailed RCA can be found in the description of this PR: #51306 and in this comment: #50886 (comment)
Details
Reusable and stylable money request amount input
Fixed Issues
$ #40382
PROPOSAL: #40382 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
android-web.mov
Android: mWeb Chrome
android.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web_0kuJlBMd.mp4
MacOS: Chrome / Safari
web_6rw0KoPH.mp4
MacOS: Desktop
desktop_MNbi88xu.mp4