Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Upload originFileObj not correct #29614

Merged
merged 2 commits into from
Mar 4, 2021
Merged

fix: Upload originFileObj not correct #29614

merged 2 commits into from
Mar 4, 2021

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Mar 4, 2021

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Upload onChange param of file.originFileObj return nest Proxy object.
🇨🇳 Chinese 修复 Upload onChange 参数 file.originFileObj 返回嵌套 Proxy 对象的问题。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2021

@codecov
Copy link

codecov bot commented Mar 4, 2021

Codecov Report

Merging #29614 (f9d318a) into master (992b99c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master    #29614   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          393       394    +1     
  Lines         7504      7565   +61     
  Branches      2111      2132   +21     
=========================================
+ Hits          7504      7565   +61     
Impacted Files Coverage Δ
components/upload/Upload.tsx 100.00% <100.00%> (ø)
components/upload/utils.tsx 100.00% <100.00%> (ø)
components/grid/col.tsx 100.00% <0.00%> (ø)
components/grid/row.tsx 100.00% <0.00%> (ø)
components/grid/RowContext.tsx 100.00% <0.00%> (ø)
components/time-picker/index.tsx 100.00% <0.00%> (ø)
components/grid/hooks/useFlexGapSupport.tsx 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 992b99c...f9d318a. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2021

Size Change: +104 B (0%)

Total Size: 836 kB

Filename Size Change
./dist/antd-with-locales.min.js 337 kB +52 B (0%)
./dist/antd.min.js 297 kB +52 B (0%)
ℹ️ View Unchanged
Filename Size Change
./dist/antd.compact.min.css 67.1 kB 0 B
./dist/antd.dark.min.css 68.4 kB 0 B
./dist/antd.min.css 67.1 kB 0 B

compressed-size-action

@zombieJ zombieJ merged commit 3c7030a into master Mar 4, 2021
@zombieJ zombieJ deleted the fix-upload branch March 4, 2021 08:59
@kerm1it
Copy link
Member

kerm1it commented Mar 4, 2021

onInternalChange(filteredFileInfoList[0]?.file, newFileList);

@zombieJ onBatchStart 触发 onChange 有问题,参数里面的 file 是 rc 那边拿过来的,不是 wrapFile 之后的,没有 originFileObjstatus 信息,此时用户在 onChange 监听到了会很奇怪,是不是可以取消触发,反正此时的 list 已经有了。

@zombieJ
Copy link
Member Author

zombieJ commented Mar 5, 2021

疏忽,应该也 wrap 一下。我改改。另外 onBatchStart 这个时机是为了受控模式用的,如果做以前的 onStart 触发兼容不是不可以,但是内部又要多一个过渡状态,会变得很恶心。不如一次性切割干净。

@RutoWeb
Copy link

RutoWeb commented Mar 11, 2021

你好,我这边有试这个upload组件,antd版本4.13.1。返回值还是一个Proxy对象。而且返回值对象里面不包含response的数据,请问是删掉response这个字段了吗?

@Vanleehao
Copy link

Vanleehao commented Mar 15, 2021

Upload 组件 originFileObj 对象为空,实测还是有问题。

@kerm1it
Copy link
Member

kerm1it commented Mar 15, 2021

Upload 组件 originFileObj 对象为空,实测还是有问题。

给个复现链接 https://codesandbox.io/s/antd-reproduction-template-6e93z?file=/index.js

@Vanleehao
Copy link

上传组件originFileObj对象为空,实测还是有问题。

给个复现链接https://codesandbox.io/s/antd-reproduction-template-6e93z?file=/index.js

版本问题,版本升级后已经修复了

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.

4 participants