Skip to content

Commit 2e4fd07

Browse files
[Security Solution][Alerts] Reset selected rows when page index changes (#243729)
> [!warning] > **I am not sure this is the right way to fix this issue**. > If you are a reviewer and have a better idea, your suggestion is more than welcome ## Summary Addresses #243190 ### 🛑 The problem As highlighted in the aforementioned issue, the selection of rows in the alerts table would persist when turning page. This is a screen-recording of the issue: https://github.com/user-attachments/assets/a3b3444a-9253-41d1-b89b-072907c7043c ### 🔍 Context - Clearing the selection after changing page is what was happening in previous versions of kibana - I have noticed that in discovery we do not do this, but in other parts of kibana we do - I couldn't really narrow the commit that caused this to happen, so I have implemented my own solution ### 💡 The solution I have added a "dependency" to the effect that resets the selection when the page size changes — I thought it was the appropriate place to do it. (cherry picked from commit cc0f9c9)
1 parent 56ae764 commit 2e4fd07

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/platform/packages/shared/response-ops/alerts-table/hooks/use_alerts_table_query_params.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const useAlertsTableQueryParams = ({
9494
pageSize,
9595
}
9696
);
97-
if (resetPageIndex) {
97+
if (resetPageIndex || pageIndex !== prevQueryParams.pageIndex) {
9898
// Clear any bulk actions selections when the query changes
9999
dispatchBulkAction({ action: BulkActionsVerbs.clear });
100100
}

0 commit comments

Comments
 (0)