Ensure header cells properly update when reordered while a search value is applied

This commit is contained in:
Andrew Kingston 2023-10-13 19:17:49 +01:00
parent e3d6a68ea1
commit 27373a9648
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,7 @@
schema, schema,
focusedCellId, focusedCellId,
filter, filter,
inlineFilters,
} = getContext("grid") } = getContext("grid")
const searchableTypes = [ const searchableTypes = [
@ -56,9 +57,14 @@
$: ascendingLabel = numericType ? "low-high" : "A-Z" $: ascendingLabel = numericType ? "low-high" : "A-Z"
$: descendingLabel = numericType ? "high-low" : "Z-A" $: descendingLabel = numericType ? "high-low" : "Z-A"
$: searchable = isColumnSearchable(column) $: searchable = isColumnSearchable(column)
$: resetSearchValue(column.name)
$: searching = searchValue != null $: searching = searchValue != null
$: debouncedUpdateFilter(searchValue) $: debouncedUpdateFilter(searchValue)
const resetSearchValue = name => {
searchValue = $inlineFilters?.find(x => x.id === `inline-${name}`)?.value
}
const isColumnSearchable = col => { const isColumnSearchable = col => {
const { type, formulaType } = col.schema const { type, formulaType } = col.schema
return ( return (