From eb5ccbb187febf751547cdd713eb803446ebd7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chy=C5=82a?= Date: Mon, 30 Sep 2024 13:35:05 +0200 Subject: [PATCH] Clear empty container state on close button click in filters (#5184) * Clear empty container state on close button click * Add changeset * Fix select channel and click on price column --- .changeset/itchy-moose-listen.md | 5 +++++ .../components/ExpressionFilters.tsx | 6 ++--- .../ConditionalFilter/useContainerState.ts | 22 ++++++++++++++++++- src/components/Datagrid/types.ts | 2 +- .../ProductListDatagrid.tsx | 4 ++-- .../ProductListDatagrid/datagrid.ts | 2 +- .../ProductListDatagrid/usePriceClick.ts | 8 ++++--- 7 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .changeset/itchy-moose-listen.md diff --git a/.changeset/itchy-moose-listen.md b/.changeset/itchy-moose-listen.md new file mode 100644 index 00000000000..06d38c45e94 --- /dev/null +++ b/.changeset/itchy-moose-listen.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Clicking a select channel on a product list and then click close button clear filter state, so when you click again select button, only one channel filter will be selected diff --git a/src/components/AppLayout/ListFilters/components/ExpressionFilters.tsx b/src/components/AppLayout/ListFilters/components/ExpressionFilters.tsx index fe956223c19..59bcca6f8c0 100644 --- a/src/components/AppLayout/ListFilters/components/ExpressionFilters.tsx +++ b/src/components/AppLayout/ListFilters/components/ExpressionFilters.tsx @@ -10,7 +10,7 @@ import { useIntl } from "react-intl"; export const ExpressionFilters = () => { const { formatMessage } = useIntl(); const { valueProvider, containerState, filterWindow } = useConditionalFilterContext(); - const clickOutside = () => { + const clearEmpty = () => { containerState.clearEmpty(); }; @@ -23,7 +23,7 @@ export const ExpressionFilters = () => { })} - + { {formatMessage(conditionalFilterMessages.popoverTitle)} -