Skip to content

feat(Upload): support draggable API#2141

Open
Wesley-0808 wants to merge 18 commits intodevelopfrom
wesley/feat/upload-draggable
Open

feat(Upload): support draggable API#2141
Wesley-0808 wants to merge 18 commits intodevelopfrom
wesley/feat/upload-draggable

Conversation

@Wesley-0808
Copy link
Copy Markdown
Collaborator

@Wesley-0808 Wesley-0808 commented Feb 3, 2026

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

fix #1903

相关 PRs

TDesignOteam/tdesign-api#811
Tencent/tdesign-common#2414

💡 需求背景和解决方案

📝 更新日志

  • feat(Upload): 新增 draggable 属性,支持拖拽排序

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 3, 2026

commit: f772ca3

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2026

完成

@Wesley-0808 Wesley-0808 requested a review from Copilot February 3, 2026 20:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds draggable functionality to the Upload component, allowing users to reorder uploaded files through drag-and-drop interactions on both desktop and mobile devices.

Changes:

  • Added draggable prop and drag/drop event handlers to enable file reordering
  • Implemented a new useDrag hook to manage drag state and perform grid-based sorting calculations
  • Updated documentation to reflect new draggable API and related events

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/upload/upload.tsx Integrated drag handlers, added TransitionGroup for animations, and wired drag events to props
src/upload/upload.md Added documentation for draggable prop and drag/drop events (Chinese)
src/upload/upload.en-US.md Added documentation for draggable prop and drag/drop events (English)
src/upload/type.ts Added TypeScript definitions for draggable prop, drag/drop callbacks, and 'sort' trigger type
src/upload/props.ts Added prop definitions for draggable, onDrag, and onDrop
src/upload/hooks/useUpload.ts Exported setUploadValue and added UseUpload interface for type safety
src/upload/hooks/useDrag.ts New hook implementing drag-and-drop logic with grid-based positioning
src/upload/demos/multiple.vue Enabled draggable in demo
src/upload/test/snapshots/demo.test.jsx.snap Updated snapshots to reflect draggable attributes in rendered output
src/image/image.tsx Added onClick prop support for Image component
src/_common Updated subproject commit reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Wesley-0808 Wesley-0808 requested a review from Copilot February 4, 2026 05:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Wesley-0808 Wesley-0808 changed the title 【WIP】feat(Upload): support draggable API feat(Upload): support draggable API Mar 20, 2026
@Wesley-0808
Copy link
Copy Markdown
Collaborator Author

/update-snapshot

@github-actions
Copy link
Copy Markdown
Contributor

⏳ 正在运行快照更新。。。 CI: Open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【Upload】组件新增 draggable 属性,支持拖拽排序

3 participants