From 2acc20f25ad7208145562d559ab86d37922d761b Mon Sep 17 00:00:00 2001 From: Elena Grednikova Date: Fri, 20 Dec 2024 20:49:43 +0100 Subject: [PATCH] Add clear button for single date search bar control --- .../SearchBar/SearchBarColumn/DateSingleColumn/hooks.ts | 2 ++ .../SearchBar/SearchBarColumn/DateSingleColumn/index.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/SearchBar/SearchBarColumn/DateSingleColumn/hooks.ts b/src/components/SearchBar/SearchBarColumn/DateSingleColumn/hooks.ts index 1a181d74..ced889fa 100644 --- a/src/components/SearchBar/SearchBarColumn/DateSingleColumn/hooks.ts +++ b/src/components/SearchBar/SearchBarColumn/DateSingleColumn/hooks.ts @@ -10,6 +10,8 @@ export function useDateColumn(props: SearchBarColumnSingleDateTypeProps) { (value: moment.Moment | null) => { if (value) { onChange(value, columnFilterValue.column.id); + } else { + onChange(undefined, columnFilterValue.column.id); } }, [onChange, columnFilterValue], diff --git a/src/components/SearchBar/SearchBarColumn/DateSingleColumn/index.tsx b/src/components/SearchBar/SearchBarColumn/DateSingleColumn/index.tsx index 18a86cf4..5572fd54 100644 --- a/src/components/SearchBar/SearchBarColumn/DateSingleColumn/index.tsx +++ b/src/components/SearchBar/SearchBarColumn/DateSingleColumn/index.tsx @@ -14,8 +14,8 @@ export function DateSingleColumn(props: SearchBarColumnSingleDateTypeProps) { onChange={onColumnChange} value={columnFilterValue.value} placeholder={placeholder} - clearIcon={false} defaultOpen={defaultOpen} + allowClear /> ); }