Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll Table Up onPageChange #67

Merged
merged 1 commit into from
Jan 9, 2019
Merged

Conversation

mattrothenberg
Copy link
Contributor

https://trello.com/c/BEEOfNb1/191-paginated-list-of-dataclips-table-should-scroll-to-the-top-when-clicking-next-to-page

When paging through a paginated HKTable, the table should scroll back to the top on page change. This functionality was achieved by:

  1. Creating a ref.
  2. Wrapping ReactTable in a div and assigning it said ref.
  3. Invoking scrollIntoView on the ref when the onPageChange event is triggered.
  4. Invoking the user's onPageChange callback as well, if one is passed.

stories/HKTable.stories.tsx Show resolved Hide resolved
@mattrothenberg mattrothenberg merged commit d9fd4bf into master Jan 9, 2019
@mattrothenberg mattrothenberg deleted the scroll-table-to-top branch January 9, 2019 20:08
@idan
Copy link
Contributor

idan commented Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants