-
-
Notifications
You must be signed in to change notification settings - Fork 478
Fix: fix scroll params #728
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
Conversation
[issue-link](ant-design/ant-design#34468)
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/select/A1bY93VcfpUTTqnBxyZFXShCeNq3 |
onKeyDown: React.KeyboardEventHandler; | ||
onKeyUp: React.KeyboardEventHandler; | ||
scrollTo?: (index: number) => void; | ||
scrollTo?: (args: number | ScrollConfig) => void; |
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.
Since the virtual list hereused (arg: number | ScrollConfig)
as its params type, so I think maybe we should allow here to accept type ScrollConfig
}); | ||
wrapper.update(); | ||
ref.current.scrollTo(100); | ||
ref.current.scrollTo(scrollParams); |
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.
Please add a new test case for this.
Codecov Report
@@ Coverage Diff @@
## master #728 +/- ##
=======================================
Coverage 99.50% 99.50%
=======================================
Files 25 25
Lines 1011 1011
Branches 320 320
=======================================
Hits 1006 1006
Misses 4 4
Partials 1 1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
LGTM |
const scrollIntoView = (args: number | ScrollConfig) => { | ||
if (listRef.current) { | ||
listRef.current.scrollTo({ index }); | ||
listRef.current.scrollTo(args); |
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.
listRef.current.scrollTo(args); | |
listRef.current.scrollTo(typeof args === 'number' ? { index: args } : args); |
issue-link