diff --git a/frontend/src/components/RecentQSOsGrid.tsx b/frontend/src/components/RecentQSOsGrid.tsx index 112b5a7..8c8c80f 100644 --- a/frontend/src/components/RecentQSOsGrid.tsx +++ b/frontend/src/components/RecentQSOsGrid.tsx @@ -407,9 +407,16 @@ export function RecentQSOsGrid({ rows, selectAllSignal, selectRowSignal, rowDrag const reportFilteredCount = useCallback((e: { api?: any }) => { const api = e?.api ?? gridRef.current?.api; if (api?.getDisplayedRowCount) setDispCount(api.getDisplayedRowCount()); + // Pass-order "#" is a rowIndex-based valueGetter; AG-Grid keeps the same + // row node across a reorder (getRowId by id), so the number is cached and + // stale until we force it. Refresh it on every model update (a reorder + // fires one). force:true bypasses the value cache. + if (passOrder && api?.refreshCells) { + api.refreshCells({ columns: ['__order'], force: true }); + } if (!api || !onFilteredCountChange) return; onFilteredCountChange(api.isAnyFilterPresent?.() ? api.getDisplayedRowCount() : null); - }, [onFilteredCountChange]); + }, [onFilteredCountChange, passOrder]); const saveColumnState = useCallback(() => { if (restoringRef.current) return; // ignore the events fired by a column rebuild const state = gridRef.current?.api?.getColumnState();