fix: when the upload setting pastable is set to true in the same Form, the copying of FormItemInput becomes invalid#624
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改优化了 Changes
Assessment against linked issues
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/AjaxUploader.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. tests/uploader.spec.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Graph Analysis (1)tests/uploader.spec.tsx (1)
🔇 Additional comments (2)
✨ Finishing Touches
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 (
|
src/AjaxUploader.tsx
Outdated
| const clipboardData = (e as ClipboardEvent).clipboardData; | ||
| items = [...(clipboardData.items || [])]; | ||
| files = [...(clipboardData.files || [])]; | ||
| hasFile = items.some(item => item.kind === 'file') || files.length > 0; |
src/AjaxUploader.tsx
Outdated
| const dataTransfer = (e as React.DragEvent<HTMLDivElement>).dataTransfer; | ||
| items = [...(dataTransfer.items || [])]; | ||
| files = [...(dataTransfer.files || [])]; | ||
| hasFile = items.some(item => item.kind === 'file'); |
There was a problem hiding this comment.
这个逻辑和下面的不一样。看起来 hasFile 变量不用定义。直接在下面写 if 就行了,逻辑合并掉
src/AjaxUploader.tsx
Outdated
| files = [...(clipboardData.files || [])]; | ||
| } | ||
|
|
||
| if (items.some(item => item.kind === 'file') || files.length > 0) { |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #624 +/- ##
==========================================
+ Coverage 89.03% 89.07% +0.03%
==========================================
Files 6 6
Lines 301 302 +1
Branches 86 87 +1
==========================================
+ Hits 268 269 +1
Misses 33 33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fix ant-design/ant-design#53907
Summary by CodeRabbit