Commit ee25874
authored
Fix pagination and cursor navigation issues (#45)
* fix(browse): move cursor with viewport on page up/down
Previously page up/down only scrolled the viewport while the cursor
stayed in place, causing it to drift off screen.
* fix(browse): fix load more pagination by excluding missing docs from offset
When using DocumentRefs() to find all refs in a collection, it returns all
document references including those on subsequent pages. These were being
added as "missing" items (docs with no data). The docCount was including
these missing items, inflating the offset used for pagination.
When "load more" was triggered, the inflated offset would skip past all
remaining documents, causing the query to return zero results. The sentinel
would disappear but no new items appeared, making it seem like nothing happened.
Fix by excluding isMissing items from the docCount calculation so the offset
only reflects documents from the actual query results.
---------
Co-authored-by: Gustavo Hoirisch <355877+gugahoi@users.noreply.github.com>1 parent f24e6e8 commit ee25874
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
| 395 | + | |
395 | 396 | | |
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
399 | | - | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
322 | 328 | | |
323 | 329 | | |
324 | 330 | | |
| |||
339 | 345 | | |
340 | 346 | | |
341 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
342 | 353 | | |
343 | 354 | | |
344 | 355 | | |
| |||
0 commit comments