mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 16:15:25 +02:00
fix: normalize filter comparison with trim and exact set match in Cosmetic Items tab
Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
co-authored by
claude-flow
parent
d69acd5872
commit
60224931bc
@@ -45,7 +45,7 @@ export function CosmeticItemsView({ data, headers, onSaveRow, onCaptureState, ro
|
||||
if (!COSMETIC_LINES.some(l => lineVal === l)) return;
|
||||
|
||||
columns.forEach(({ col }) => {
|
||||
result[col].add(String(row[col] ?? ''));
|
||||
result[col].add(String(row[col] ?? '').trim());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -83,10 +83,12 @@ export function CosmeticItemsView({ data, headers, onSaveRow, onCaptureState, ro
|
||||
if (!filterValues || filterValues.length === 0) return;
|
||||
const colNum = parseInt(colIdx);
|
||||
const allVals = getUniqueValues(colNum);
|
||||
if (filterValues.length >= allVals.length) return;
|
||||
// If all known values selected, no filtering needed
|
||||
const filterSet = new Set(filterValues);
|
||||
if (filterSet.size >= allVals.length && allVals.every(v => filterSet.has(v))) return;
|
||||
result = result.filter(({ row }) => {
|
||||
const val = String(row[colNum] ?? '');
|
||||
return filterValues.includes(val);
|
||||
const val = String(row[colNum] ?? '').trim();
|
||||
return filterValues.some(f => f.trim() === val);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user