Skip to content

fix(components): [upload] ensure onChange receives updated fileList#22760

Merged
YunYouJun merged 3 commits intoelement-plus:devfrom
yicheny:fix/22676-upload-onchange
Nov 12, 2025
Merged

fix(components): [upload] ensure onChange receives updated fileList#22760
YunYouJun merged 3 commits intoelement-plus:devfrom
yicheny:fix/22676-upload-onchange

Conversation

@yicheny
Copy link
Copy Markdown
Contributor

@yicheny yicheny commented Nov 11, 2025

  • defer onChange emission to next tick so v-model sync completes

  • add regression test covering v-model:fileList synchronization

closed #22676

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

- defer onChange emission to next tick so v-model sync completes

- add regression test covering v-model:fileList synchronization

closed element-plus#22676
@pull-request-triage
Copy link
Copy Markdown

👋 @yicheny, seems like this is your first time contribution to element-plus.
Please make sure that you have read our guidelines and code of conduct before making a contribution.

@pull-request-triage pull-request-triage bot added 1st contribution Their very first contribution Needs Review labels Nov 11, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 11, 2025

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Nov 11, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus/element-plus@22760

commit: 187f656

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 11, 2025

🧪 Playground Preview: https://element-plus.run/?pr=22760
Please comment the example via this playground if needed.

- import UploadFiles for the new regression test

- type refs and handlers to satisfy lint/typecheck

closed element-plus#22676
@jyj1202
Copy link
Copy Markdown

jyj1202 commented Nov 12, 2025

this solution is unique.

@yicheny
Copy link
Copy Markdown
Contributor Author

yicheny commented Nov 12, 2025

Type definitions have been added. Could you please review it again? @rzzf

Copy link
Copy Markdown
Member

@rzzf rzzf left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@rzzf rzzf changed the title fix(components): ensure onChange receives updated fileList fix(components): [upload] ensure onChange receives updated fileList Nov 12, 2025
Copy link
Copy Markdown
Member

@warmthsea warmthsea left a comment

Choose a reason for hiding this comment

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

LGTM

@YunYouJun YunYouJun merged commit eaeba4f into element-plus:dev Nov 12, 2025
13 checks passed
@github-actions
Copy link
Copy Markdown

@yicheny Thanks for your contribution! ❤️

@element-bot element-bot mentioned this pull request Nov 15, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Component] [upload] 【Upload组件】onchange 函数中无法获取到v-model:fileList 新值

5 participants