mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix(table): fix cross-filter not clearing on second click in Interactive Table (#39253)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
44e77fdf2b
commit
c2d96e0dce
@@ -415,7 +415,16 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||
|
||||
const isActiveFilterValue = useCallback(
|
||||
function isActiveFilterValue(key: string, val: DataRecordValue) {
|
||||
return !!filters && filters[key]?.includes(val);
|
||||
if (!filters || !filters[key]) return false;
|
||||
return filters[key].some(filterVal => {
|
||||
if (filterVal === val) return true;
|
||||
// DateWithFormatter extends Date — compare by time value
|
||||
// since memoization cache misses can create new instances
|
||||
if (filterVal instanceof Date && val instanceof Date) {
|
||||
return filterVal.getTime() === val.getTime();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
},
|
||||
[filters],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user