Skip to content

Tables don't scroll back to top on page change #55

Description

@mcdemarco

I investigated the failure of tables to scroll to top on pagination because I was surprised it wasn't happening. I haven't seen anyone defend pagination without scrolling to the top of the new page as a desirable UX. Unfortunately, there's a won't-fix bug for it in TanStack tables, which we're using (#772). So I'm documenting it for the record.

The suggested workarounds are unsatisfactory because we have a lot of tables we'd have to edit, and, because we have multiple tables on a page, we can't just scroll to the top of <tbody> (which is the equivalent of the suggestions involving a class name). I found a more general react-hacking workaround, for a similar component with a similar won't-fix scrolling problem: #902, which might work for us. (Even though the commenter says it scrolls to the top of the page, it looks like it scrolls to the top of the table.)

I couldn't find a different table component that does this out-of-the-box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions