Skip to content

Commit a70b6f6

Browse files
committed
Fix pagination bar disappearing on 0 results for Shiny server backends
Track the highest row count seen across server data fetches so the pagination bar stays visible after filtering or searching reduces results to zero. This matches the existing DuckDB WASM client behavior. Backends that provide an explicit maxRowCount (V8) are still respected via Math.max.
1 parent 95f1e12 commit a70b6f6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎srcjs/Reactable.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,10 @@ function Table({
12361236
const { rowCount, maxRowCount } = body
12371237
setNewData(data)
12381238
setServerRowCount(rowCount)
1239-
setServerMaxRowCount(maxRowCount)
1239+
// Track the highest row count seen so pagination doesn't auto-hide after
1240+
// a search or filter reduces results to zero. Use the backend-provided
1241+
// maxRowCount if available (e.g., V8), otherwise track the max of rowCount.
1242+
setServerMaxRowCount(prev => Math.max(prev ?? 0, maxRowCount ?? rowCount))
12401243
})
12411244
.catch(err => {
12421245
console.error(err)

0 commit comments

Comments
 (0)