From 27373a9648585baf8c5f812dfcd29f63c1c19aeb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 13 Oct 2023 19:17:49 +0100 Subject: [PATCH] Ensure header cells properly update when reordered while a search value is applied --- .../src/components/grid/cells/HeaderCell.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte index d4ed41efd3..a053b2a6f0 100644 --- a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte @@ -28,6 +28,7 @@ schema, focusedCellId, filter, + inlineFilters, } = getContext("grid") const searchableTypes = [ @@ -56,9 +57,14 @@ $: ascendingLabel = numericType ? "low-high" : "A-Z" $: descendingLabel = numericType ? "high-low" : "Z-A" $: searchable = isColumnSearchable(column) + $: resetSearchValue(column.name) $: searching = searchValue != null $: debouncedUpdateFilter(searchValue) + const resetSearchValue = name => { + searchValue = $inlineFilters?.find(x => x.id === `inline-${name}`)?.value + } + const isColumnSearchable = col => { const { type, formulaType } = col.schema return (