Fix split amount input does not animate smoothly#42241
Fix split amount input does not animate smoothly#42241youssef-lr merged 5 commits intoExpensify:mainfrom
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 |
| 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.
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.
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 |
abdulrahuman5196
left a comment
There was a problem hiding this comment.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @youssef-lr
🎀 👀 🎀
C+ Reviewed
|
✋ 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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