-
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
Fix split amount input does not animate smoothly #42241
Fix split amount input does not animate smoothly #42241
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] |
@youssef-lr I noticed another issue. The cents amount doesn't show immediately as you can see from the video below (0:10) Screen.Recording.2024-05-16.at.13.56.47.movThis is because the initial state of the amount is always converted to the FE amount that removes the cent (/ 100). App/src/components/MoneyRequestAmountInput.tsx Lines 116 to 118 in e9cf0c5
I want to do it like this
but I think formatAmountOnBlur doesn't sound correct. Should we rename it to something else or just keep the name? |
Ok I fixed it by moving the logic to a prop (onFormatAmount), this allows for more reusablity for having different formatting logic. |
I don't remember seeing this issue initially, could it be from the refactor to using |
@@ -113,7 +125,7 @@ function MoneyRequestAmountInput( | |||
const textInput = useRef<BaseTextInputRef | null>(null); | |||
|
|||
const decimals = CurrencyUtils.getCurrencyDecimals(currency); | |||
const selectedAmountAsString = amount ? CurrencyUtils.convertToFrontendAmount(amount).toString() : ''; |
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 think it's been there because this is an old logic. selectedAmountAsString is used as the initial state for the amount and we don't use the correct formatting logic for our case.
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.
ah okay, that makes sense, thanks for catching this!
bump @abdulrahuman5196 for review please |
Checking now |
@bernhardoj I am seeing layout issues in android chrome which is not present in staging. Other platforms there is no issue. Could you check on this? Screen.Recording.2024-05-28.at.6.14.07.PM.mov |
IT's a known issue. I have merged with main to pull the fix. |
Got it. Thank you. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-05-28.at.6.04.41.PM.movAndroid: mWeb ChromeScreen.Recording.2024-05-28.at.11.23.12.PM.moviOS: NativeScreen.Recording.2024-05-28.at.5.58.47.PM.moviOS: mWeb SafariScreen.Recording.2024-05-28.at.6.03.54.PM.movMacOS: Chrome / SafariScreen.Recording.2024-05-28.at.5.31.12.PM.movMacOS: DesktopScreen.Recording.2024-05-28.at.5.48.18.PM.mov |
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. @youssef-lr
🎀 👀 🎀
C+ Reviewed
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
✋ 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.77-11 🚀
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
Details
The input currently use autoGrow which needs to initialize the width from the onLayout event, so for a brief moment, the width is 0. This PR changes it to a fixed width input.
Fixed Issues
$ #41751
PROPOSAL: #41751 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
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
Screen.Recording.2024-05-16.at.13.56.47.mov
Android: mWeb Chrome
Screen.Recording.2024-05-16.at.13.54.10.mov
iOS: Native
Screen.Recording.2024-05-16.at.13.52.11.mov
iOS: mWeb Safari
Screen.Recording.2024-05-16.at.13.53.09.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-16.at.13.54.48.mov
MacOS: Desktop
Screen.Recording.2024-05-16.at.13.56.03.mov