【Auto】Fix: Trigger uploadProps onRemove in AIChatInput#3138
Open
SudoUserReal wants to merge 1 commit intomainfrom
Open
【Auto】Fix: Trigger uploadProps onRemove in AIChatInput#3138SudoUserReal wants to merge 1 commit intomainfrom
SudoUserReal wants to merge 1 commit intomainfrom
Conversation
This commit was automatically generated by Semi Issue Solver. Closes #3100
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4ac5283:
|
semi-design
|
||||||||||||||||||||||||||||||
| Project |
semi-design
|
| Branch Review |
solve/issue-3100-1772009334105
|
| Run status |
|
| Run duration | 08m 16s |
| Commit |
|
| Committer | SudoUser |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
1
|
|
|
0
|
|
|
13
|
|
|
0
|
|
|
290
|
Upgrade your plan to view test results. | |
| View all changes introduced in this branch ↗︎ | |
Tests for review
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #3100
AIChatInput 的附件删除按钮是自定义实现,删除时仅更新内部附件状态并触发 onChange,但没有走 Upload 的移除流程,导致传入的
uploadProps.onRemove(以及beforeRemove的拦截逻辑)不会生效。本次修复在 foundation 的删除逻辑中补齐与 Upload 一致的 remove 事件链路:删除前执行
uploadProps.beforeRemove(支持 Promise,返回 false/resolve false 则阻止删除),删除后触发uploadProps.onRemove并同步相关变更回调。同时补充了 foundation 级别回归测试覆盖 onRemove 触发与 beforeRemove 阻断场景,并更新组件文档说明相关回调行为,方便使用者正确接入。
Changelog
🇨🇳 Chinese
🇺🇸 English
Checklist
Other
Additional information
新增测试位于
packages/semi-ui/aiChatInput/__test__/aiChatInputFoundation.test.js,覆盖beforeRemove(含 Promise)返回 false 时不删除,以及删除后触发onRemove的行为。