- Notifications
You must be signed in to change notification settings - Fork4.4k
fix: scroll list widget to top on page change (#41287)#41432
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:release
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
coderabbitaibot commentedNov 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
WalkthroughAdded a public Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates thehigh-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for usingCodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/widgets/ListWidget/widget/index.tsx (1)
851-860:scrollToTop helper and usage meet the UX goal; DOM targeting could be tightened (optional)This implementation cleanly resets scroll after both server-side page changes (
onPageChange) and client-side ones, and thesetTimeout(..., 0)is a reasonable way to ensure the DOM is updated before scrolling.If you touch this again, one optional refinement would be to avoid a global
document.querySelectoron.${widgetId}and instead either:
- attach a
refto the actual scroll container, or- at least narrow the selector to that specific scrollable element,
so the behavior is less coupled to class naming conventions and less prone to future markup changes. Functionally, though, this is fine for the current fix.
Also applies to: 875-877
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/widgets/ListWidget/widget/index.tsx(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-12T07:40:10.816Z
Learnt from: rahulbarwalRepo: appsmithorg/appsmith PR: 40632File: app/client/src/widgets/TableWidgetV2/component/VirtualTable/InifiniteScrollBody/useInfiniteScroll.tsx:84-87Timestamp: 2025-05-12T07:40:10.816ZLearning: In React Window, visibleStopIndex (often renamed as lastRenderedRowInTheCurrentView in TableWidgetV2) updates as soon as items become partially visible in the viewport. Adding +1 to this index before calculating the current page would incorrectly consider rows not present in the current viewport, potentially causing issues with pagination and infinite scroll logic.Applied to files:
app/client/src/widgets/ListWidget/widget/index.tsx
🔇 Additional comments (1)
app/client/src/widgets/ListWidget/widget/index.tsx (1)
1544-1547:Client-side pagination scroll reset looks goodUpdating
state.pageand then callingscrollToTophere ensures client-side pagination now mirrors the fixed behavior for server-side pagination, with minimal and clear code. No issues from my side.
Uh oh!
There was an error while loading.Please reload this page.
Description
Fixes List widget UX issue where content stayed scrolled down when changing pages. Now scrolls to top on page change for better user experience.
Fixes:#41287
Tested locally:
yarn devFiles changed:
app/client/src/widgets/ListWidget/index.tsx(3 lines)First-time contributor! 🚀
Automation
/ok-to-test
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.