Skip to content

Commit

Permalink
fix(pagesizecontainer): handelling page size bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepunbxd005 committed Dec 3, 2020
1 parent 83058b2 commit 99a87f7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/modules/pageSize/PageSizeContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ class PageSizeContainer extends React.PureComponent {
helpers: { setPageSizeConfiguration }
} = this.props;
const setPageSize = unbxdCore.setPageStart.bind(unbxdCore);
const getResults = unbxdCore.getResults.bind(unbxdCore);
const { noOfPages = 0 } = unbxdCore.getPaginationInfo() || {};
const onPageSizeClick = (pagesizeOption) => {
const pageSize = pagesizeOption.target.value;
const size = pagesizeOption.target
? parseInt(pageSize)
const pageSize = pagesizeOption.target && parseInt(pagesizeOption.target.value);
const size = pageSize
? pageSize
: pagesizeOption.id;
const updatedSizeOptions = sizeOptions.map((sizeOption) => ({
...sizeOption,
Expand All @@ -66,9 +65,7 @@ class PageSizeContainer extends React.PureComponent {
},
true
);
parseInt(pageSize)
? setPageSize(parseInt(pageSize))
: setPageSize(pagesizeOption.id);
setPageSize(size)
};
const { size, sizeOptions } = this.state;
return {
Expand Down

0 comments on commit 99a87f7

Please sign in to comment.