Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Reset selected items when tab switch

Krzysztof Bialoglowiczead3a0a7b21d
diff --git a/saleor/static/dashboard-next/orders/views/OrderList/OrderList.tsx b/saleor/static/dashboard-next/orders/views/OrderList/OrderList.tsx
index 3c8991eef4..d1eedf7f67 100644
--- a/saleor/static/dashboard-next/orders/views/OrderList/OrderList.tsx
+++ b/saleor/static/dashboard-next/orders/views/OrderList/OrderList.tsx
@@ -103,13 +103,15 @@ export const OrderList: React.StatelessComponent<OrderListProps> = ({
})
);
- const handleTabChange = (tab: number) =>
+ const handleTabChange = (tab: number) => {
+ reset();
navigate(
orderListUrl({
activeTab: tab.toString(),
...getFilterTabs()[tab - 1].data
})
);
+ };
const handleFilterTabDelete = () => {
deleteFilterTab(currentTab);
diff --git a/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx b/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx
index 8ef1de90a8..6397d6e59c 100644
--- a/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductList/ProductList.tsx
@@ -107,13 +107,15 @@ export const ProductList: React.StatelessComponent<ProductListProps> = ({
})
);
- const handleTabChange = (tab: number) =>
+ const handleTabChange = (tab: number) => {
+ reset();
navigate(
productListUrl({
activeTab: tab.toString(),
...getFilterTabs()[tab - 1].data
})
);
+ };
const handleFilterTabDelete = () => {
deleteFilterTab(currentTab);