-
Notifications
You must be signed in to change notification settings - Fork 164
fix: Skip scroll when draggable #304
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough该 PR 对 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant S as useScrollDrag
U->>S: 触发 onMouseDown 事件
alt 目标元素可拖动
S-->>U: 提前退出处理
else 目标元素不可拖动
S->>S: 执行拖动逻辑
S-->>U: 完成事件处理
end
sequenceDiagram
participant T as 测试用例
participant L as List组件
T->>L: 模拟拖动行为 (mouse down, move)
alt 项目未标记为可拖动
L-->>T: 滚动位置增加或重置
else 项目标记为可拖动
L-->>T: 滚动位置保持不变
end
Possibly related PRs
Suggested reviewers
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/hooks/useScrollDrag.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
tests/scroll.test.jsOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (4)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #304 +/- ##
=======================================
Coverage 97.51% 97.51%
=======================================
Files 19 19
Lines 804 806 +2
Branches 193 194 +1
=======================================
+ Hits 784 786 +2
Misses 20 20 ☔ View full report in Codecov by Sentry. |
fix ant-design/ant-design#52774
Summary by CodeRabbit