Skip to content

Commit

Permalink
fix #682
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Sep 11, 2016
1 parent afd446a commit 635b838
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pagination/PaginationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PaginationList extends Component {
changeSizePerPage = e => {
e.preventDefault();

const selectSize = parseInt(e.currentTarget.text, 10);
const selectSize = parseInt(e.currentTarget.getAttribute('data-page'), 10);
let { currPage } = this.props;
if (selectSize !== this.props.sizePerPage) {
this.totalPages = Math.ceil(this.props.dataSize / selectSize);
Expand Down Expand Up @@ -69,11 +69,14 @@ class PaginationList extends Component {
};

const sizePerPageOptions = sizePerPageList.map((_sizePerPage) => {
const pageText = _sizePerPage.text || _sizePerPage;
const pageNum = _sizePerPage.value || _sizePerPage;
return (
<li key={ _sizePerPage } role='presentation'>
<li key={ pageText } role='presentation'>
<a role='menuitem'
tabIndex='-1' href='#'
onClick={ this.changeSizePerPage }>{ _sizePerPage }</a>
data-page={ pageNum }
onClick={ this.changeSizePerPage }>{ pageText }</a>
</li>
);
});
Expand Down

0 comments on commit 635b838

Please sign in to comment.