-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
fix: Pagination sizeOptions select search handled by showSizeOptionsSearch prop #565
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CI failed. |
@yoyo837 |
You only need to run |
@yoyo837 what kind of |
@yoyo837 Weird when I run test in cloned pagination it's ok, but when in forked it's broken. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #565 +/- ##
==========================================
+ Coverage 98.70% 98.72% +0.01%
==========================================
Files 3 3
Lines 310 314 +4
Branches 137 140 +3
==========================================
+ Hits 306 310 +4
Misses 4 4 ☔ View full report in Codecov by Sentry. |
@yoyo837 Should we change snap manually? |
See #554 (comment) for API |
Just make the original property still working but deprecated. |
I'm using Nodejs v18.19.1. I think this may have nothing to do with the difference in node versions between you and me. |
@afc163 i'm using next version of this package |
src/interface.ts
Outdated
@@ -17,10 +18,19 @@ export interface PaginationLocale { | |||
page_size?: string; | |||
} | |||
|
|||
export interface PaginationPageSizeChanger | |||
extends Pick<SelectProps, 'showSearch'> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a good choice to export props from SelectProps since it's decided by selectComponentClass
. Origin design is coupling. We should not make this more coupling.
We can make showSizeChanger
to support renderProps:
<Pagination
showSizeChanger={({ value, onChange }) => (
<Select value={value} onChange={onChange} showSearch />
)}
/>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zombieJ I don't see full picture of solution, can you be more specific?
So showSizeChanger
would be a bool or react element?
What is the default behavior for pagination size changer, with search or without?
What about all other props that related to size changer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Like this:
interface PaginationProps {
// ...
showSizeChanger?: boolean | ({ value, onChange }) => ReactNode;
}
When user want more flexible, use render props to create the selection element.
We can’t reopen. Feel free to open an new one. |
Add ability to control sizeOptions select to have search or not
ant-design-issue
ant-design-pr