-
Notifications
You must be signed in to change notification settings - Fork 167
type: enhance scrollTo ts type #91
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
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/virtual-list/et0v166me |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #91 +/- ##
=======================================
Coverage 97.67% 97.67%
=======================================
Files 19 19
Lines 818 818
Branches 194 196 +2
=======================================
Hits 799 799
Misses 19 19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
没发现改动这个的必要。 |
|
@afc163 现在要手动触发显示滚动条,在 ts 中调用 |
|
@nuintun is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
@nuintun 给个重现看看? |
import { memo, useRef } from 'react';
import List, { ListRef } from 'rc-virtual-list';
const data = Array.from({ length: 1000 }).map((_, index) => ({
id: index
}));
export default memo(function Page() {
const ref = useRef<ListRef>(null);
const onClick = () => {
ref.current?.scrollTo();
};
return (
<>
<List ref={ref} data={data} height={60} itemHeight={20} itemKey="id">
{data => <div>{data.id}</div>}
</List>
<br />
<button onClick={onClick}>显示滚动条</button>
</>
);
});有需求在某些情况下要触发显示滚动条 |
Walkthrough本次变更调整了 Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/List.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|

virtual-list/src/hooks/useScrollTo.tsx
Lines 21 to 25 in fe039bf
Summary by CodeRabbit
null时调用滚动功能,提升了滚动操作的灵活性。