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

feat: add selfControlled prop to Pagination for indication of outside page control #330

Merged
merged 3 commits into from
Aug 25, 2022

Conversation

szhang-eightfold
Copy link
Contributor

@szhang-eightfold szhang-eightfold commented Aug 25, 2022

SUMMARY:

Currently, the page would be redirected back to 1 if component rerender due to size change, and what will happen is, when we pass in value 2 to currentPage prop, on initial render of the component, it will trigger the onCurrentChange function automatically due to useEffect -> onSizeChangeHandler -> handleCurrentChange(1).

The new added prop will skip the handleCurrentChange(1) step

This changes is helpful for implementation like using url param to store page state from the outside.

GITHUB ISSUE (Open Source Contributors)

JIRA TASK (Eightfold Employees Only):

https://eightfoldai.atlassian.net/jira/software/c/projects/ENG/boards/29?modal=detail&selectedIssue=ENG-26836
https://eightfoldai.atlassian.net/jira/software/c/projects/ENG/boards/29?modal=detail&selectedIssue=ENG-27695

CHANGE TYPE:

  • Bugfix Pull Request
  • Feature Pull Request

TEST COVERAGE:

  • Tests for this change already exist
  • I have added unittests for this change

TEST PLAN:

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f1473dd:

Sandbox Source
React Configuration
Vanilla Configuration

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@ba20e6b). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #330   +/-   ##
=======================================
  Coverage        ?   88.33%           
=======================================
  Files           ?      402           
  Lines           ?    10803           
  Branches        ?     3667           
=======================================
  Hits            ?     9543           
  Misses          ?     1237           
  Partials        ?       23           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@szhang-eightfold szhang-eightfold merged commit 4ef4aec into EightfoldAI:main Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants