From 32fefaefab36eb4a57718256fee7e7f180ae89f3 Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Wed, 7 May 2025 19:53:02 +0530 Subject: [PATCH] fix: reset table page number on infinite scroll reset (#40603) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Problem Table pagination would not reset properly when infinite scroll was reset, leading to incorrect data display or user being stuck on a non-existent page. Root cause The `resetTableForInfiniteScroll` method did not reset the page number, causing the table to continue from an outdated page index. Solution This PR handles resetting the page number to 0 in the `resetTableForInfiniteScroll` method, ensuring the table starts from the first page during infinite scroll resets for consistent pagination behavior. Fixes #40594 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Table" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: ec11d1637f68bcdcdf42dbb8b8078bdf468f40f1 > Cypress dashboard. > Tags: `@tag.Table` > Spec: >
Wed, 07 May 2025 14:22:58 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **Bug Fixes** - Resolved an issue where resetting the table with infinite scroll did not return to the first page. Now, the table correctly resets to the first page when infinite scroll is used. --- app/client/src/widgets/TableWidgetV2/widget/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/client/src/widgets/TableWidgetV2/widget/index.tsx b/app/client/src/widgets/TableWidgetV2/widget/index.tsx index 6b3c490122..1f6b595061 100644 --- a/app/client/src/widgets/TableWidgetV2/widget/index.tsx +++ b/app/client/src/widgets/TableWidgetV2/widget/index.tsx @@ -3066,6 +3066,7 @@ class TableWidgetV2 extends BaseWidget { resetTableForInfiniteScroll = () => { resetWidget(this.props.widgetId, false); + this.updatePageNumber(0, EventType.ON_NEXT_PAGE); }; }