fix: preserve drag text set by consumers - #1071
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughTree 的拖拽开始流程先写入默认 Changes拖拽数据顺序
Estimated code review effort: 2 (简单) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change initializes the Firefox drag-text fallback before the consumer callback so consumer-provided text is preserved, with focused regression coverage and all reported checks passing; no actionable merge-blocking risk remains. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1071 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 15 15
Lines 1319 1319
Branches 400 400
=======================================
Hits 1317 1317
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
text/plaindrag fallback before invoking the consumer callbackonDragStartconsumers to set or override the drag text payloadDataTransfervalueFixes #931.
Why
The Firefox fallback is still required, but applying it after the consumer callback overwrote any
text/plainvalue set by the consumer. Initializing it first preserves the fallback while allowing the public callback to provide the actual payload.Verification
TreeDraggable.spec.tsx: 37/37 tests passedgit diff --checkpassedAI assistance disclosure: Codex was used to trace the drag-start flow, implement the focused fix, add the regression test, and run verification. The behavior and test results above were verified in this branch.
Summary by CodeRabbit
text/plain拖拽内容。