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

这是bug还是feature? Pagination 组件total大于50时showSizeChanger默认为true,pageSize修改时onChange不会触发,需要添加onShowSizeChange方法 #24913

Closed
1 task done
without-yy opened this issue Jun 11, 2020 · 9 comments

Comments

@without-yy
Copy link

without-yy commented Jun 11, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1

What is expected?

showSizeChange 默认值不跟随total变化,或 pageSize修改时触发onChange, 移除onShowSizeChange

What is actually happening?

pageSize修改时onChange不会触发,需要添加onShowSizeChange方法

Environment Info
antd 4.3.3
React 16.12
System MacOS 10.15
Browser Chrome 83.0.4103.97
@yoyo837
Copy link
Contributor

yoyo837 commented Jun 11, 2020

目前实现是这样,onShowSizeChange 没触发onChange.

@yoyo837
Copy link
Contributor

yoyo837 commented Jun 11, 2020

@without-yy
Copy link
Author

目前实现是这样,onShowSizeChange 没触发onChange.

当前的实现方式showSizeChange参数的默认值不太合理,没有添加onShowSizeChange事件时即使为true,也没有任何意义,还会对调用者造成迷惑

@yoyo837
Copy link
Contributor

yoyo837 commented Jun 11, 2020

没太明白,什么即使为true?

@without-yy
Copy link
Author

showSizeChanger: 是否展示 pageSize 切换器,当 total 大于 50 时默认为 true

我在开发过程中完全没有在意到这个参数,当数据多的时候才意识到,这才发现了onChange没有触发,需要再增加onShowSizeChange事件

@afc163
Copy link
Member

afc163 commented Jun 11, 2020

看上去确实需要触发一下 onChange。

@yoyo837
Copy link
Contributor

yoyo837 commented Jun 11, 2020

看上去确实需要触发一下 onChange。

然后就回到了 react-component/pagination#272 (comment) 的讨论

@fireairforce 重启修改?

@fireairforce
Copy link
Member

ok~改了

@afc163
Copy link
Member

afc163 commented Jun 13, 2020

Fixed in #24964

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

No branches or pull requests

4 participants