box / box/box-ui-elements

Content Picker Pagination Not Working

Open
#2,068 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
551
Forks
351
Avg merge
5d 9h
Merged PRs (30d)
31

Description

**Environment:**

- Elements version:
All v12 versions

**Desktop (please complete the following information):**
- OS: All OS including Windows 10 and Mac OS and all versions
- Browser: All browsers including Chrome, Safari, IE and all versions

**Smartphone (please complete the following information):**

- Device: All devices
- OS: All OS and all versions
- Browser: All browsers and all versions

**Steps to reproduce the problem:**
Attempt to paginate through content picker

**What is the expected behavior? (Screenshots can be helpful here)**
Should be able to paginate

**What went wrong? (Screenshots, console logs, or HAR files can be helpful here)**
Unable to paginate. No network requests triggered, no console errors or messages at all

**Link to application or sample code:**

**If relevant, link to file (or attach file here)**

**Expected behavior**
You should be able to paginate

**Screenshots**

**Additional context**
The pagination feature of the content picker in Box UI Elements v12 including v12.0.0-beta.46 is not working. It seems the onChange handler for the Pagination react component is set by the ContentPicker component, but the Pagination component ignores the onChange prop.

Here's the ContentPicker passing onChange:
https://github.com/box/box-ui-elements/blob/master/src/elements/content-picker/ContentPicker.js#L1238

This seems to be a regression because version 11.0.2 works fine and the Pagination component does handle that onChange prop.

It looks like the fix would be to do one of the following:
1. Change ContentPicker to pass onOffsetChange instead of onChange
2. Change both Pagination.js and OffsetBasedPagination.js so the prop they receive is named onChange instead of onOffsetChange

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.