react-component / react-component/pagination
onShowSizeChange方法调用后还会调用onPageChange
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 674
- Forks
- 333
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Description
期望给onShowSizeChange增加返回值,通过返回值判断是否要继续执行onPageChange,现在只要传了onShowSizeChange,就会调用onPageChange,是否可以这样,比如
_this.changePageSize = function (size) {
/*... 原来的逻辑 ... */
//在这里增加个判断,可以让用户选择是否继续调用onChange,也可以用户手动调用
const noChangePage = _this.props.onShowSizeChange(current, size);
if (noChangePage === 'reject') return
if ('onChange' in _this.props && _this.props.onChange) {
_this.props.onChange(current, size);
}
};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the changePageSize entry point shown in the issue and trace how onShowSizeChange, onChange, and onPageChange are currently invoked. Clarify whether the requested return value controls onChange or onPageChange, then define and test the callback behavior and preserve existing behavior when no return value is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100