Fix: scroll to bottom when error appears after content size change#71426
Fix: scroll to bottom when error appears after content size change#71426NagaraniKaleeswaran wants to merge 1 commit into
Conversation
|
@ikevin127 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] |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
1 similar comment
|
recheck |
|
@NagaraniKaleeswaran Thanks for opening the PR! A few things that need addressed in order to move forward with the review:
🟡 Currently you added what looks like a recording of MacOS: Chrome / Safari (main Web app), but you added it to Android: mWeb Chrome instead which is incorrect / ❌ and you're missing the videos for all other platforms which currently causes a blocker the PR review. ℹ️ Refer to the contributor guidelines / local development for setup details on all environments / platforms.
Precondition:
- Sign in to a Expensifail account in OD
- Create one or 2 group workspaces if there is no existing workspaces
- Set the Individual workspace as default
1. Login to ND.
2. Click the FAB > Book Travel.
3. Click the Book travel.
4. Verify: As soon as the error message renders, the page auto-scrolls so the error is fully visible.☝️ That's it in terms of tests, you only have to specify test steps to verify your fix. @NagaraniKaleeswaran Also I noticed you applied changes to the |
|
@ikevin127 Here’s how I’ll address each point: Screenshots/Videos – Understood. I’ll build and run the app on all required platforms and upload the video proof for each in the correct section:
PROPOSAL section – I’ll update this with a direct link to the original issue proposal instead of “N/A”. Offline tests – I’ll mark this as N/A since this fix doesn’t involve any offline behavior. Tests section – I’ll rewrite it to include the preconditions and detailed test steps along with the verification step, as you suggested. Changes in I’ll make these changes and push an updated PR shortly ✅ |
|
@ikevin127 At the moment, I don’t have access to Android/iOS devices or emulators or the Mac desktop app, so I wasn’t able to record the fix for:
Could someone from the review/QA team please help confirm the behavior on those platforms? 🙏 Thanks again, and let me know if I should adjust anything else in the PR. |
|
recheck |
|
@NagaraniKaleeswaran It's fine if you stop from commenting
Well that's a problem, as all contributors are expected to be able to run the tests on all platforms, it's part of the checklist and there's no way around it - this is also why it's important to be able to test your proposal / fix on all platforms BEFORE you even post a proposal to ensure your fix works on all platforms without breaking things on any of them. 🟡 We're on HOLD for now as this is a blocker, I'll have to take this up with the team and get back to you with an answer regarding moving forward here. |
|
While waiting for a response from the team, just want to let you know that there are ways for you to access a MacOS machine at a low cost, we have this documented here. |
I have seen the document will try to test in all platforms |
@NagaraniKaleeswaran It's been over 1 week since assignment which technically means contract termination - but because it's your first assignment and you might have not known about the testing situation - please let me knoe how is it going, are you able to add test proof for all platforms ? ♻️ Otherwise let me know so we can proceed to next steps here:
|
I have tested in all platforms will upload tomorrow @ikevin127 |
|
@ikevin127 |
|
@NagaraniKaleeswaran The task was reassigned, no need to post the videos anymore - feel free to close the PR and stand-by for more info on the issue from the BZ team member regarding payment. |
Thanks for informing sorry for the inconvenience for next task I will be fully prepared |
Explanation of Change
This PR ensures the page auto-scrolls to the bottom whenever a new error message is rendered and causes the content size to grow.
In BookTravelButton.tsx, I centralized error setting in a showError() helper which also toggles a shouldScrollToBottom flag (passed from the parent).
In ManageTrips.tsx, I listen to onContentSizeChange on the page ScrollView and, when shouldScrollToBottom is true, I programmatically call scrollToEnd({animated: true}) and reset the flag.
This addresses the case where validation / eligibility errors appear below the fold (e.g., when booking travel) and were previously off-screen.
###Fixed Issues
$ #70601
PROPOSAL: #70601 (comment)
###Tests
Precondition
Steps
Extra scenario (BookTravelButton errors)
Offline tests N/A
QA Steps
Same as Tests above.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)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
Windows: Chrome ✅
[✔️] Verified that the page auto-scrolls when the error message appears.
scroll-error.mp4
Windows: Edge ✅
[✔️] Verified that the page auto-scrolls when the error message appears.
Scroll-error-edge.webm
Android: Native ❌
Not tested (no device/emulator access)
Android: mWeb Chrome ❌
Not tested (no device/emulator access)
iOS: Native ❌
Not tested (no device/emulator access)
iOS: mWeb Safari ❌
Not tested (no device/emulator access)
MacOS: Desktop ❌
Not tested (no desktop app access)