Skip to content

fix(Input): fix warning about failed setting prop size on input element #5508

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

Merged
merged 2 commits into from
Apr 19, 2022

Conversation

buqiyuan
Copy link
Member

@buqiyuan buqiyuan commented Apr 16, 2022

First of all, thank you for your contribution! 😄

fix: #5177, #5504, #5503, #5509

New feature please send pull request to feature branch, and rest to master branch. Pull request will be merged after one of collaborators approve. Please makes sure that these form are filled before submitting your pull request, thank you!

[中文版模板 / Chinese template]

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

复现问题版本:vue 3.2.33
这个warning算是vue的问题吧!我们要不暂时先这么处理:把属性值为undefinedprop过滤掉,这样一来对Input原来的功能也不影响,只是暂时解决Vue warn问题,我同时也给vue提了一个相关PR
before:
image
after:
image

API Realization (Optional if not new feature)

  1. Basic thought of solution and other optional proposal.
  2. List final API realization and usage sample.
  3. GIF or snapshot should be provided if includes UI/interactive modification.

What's the effect? (Optional if not new feature)

  1. Does this PR affect user? Which part will be affected?
  2. What will say in changelog?
  3. Does this PR contains potential break change or other risk?

Changelog description (Optional if not new feature)

  1. English description
  2. Chinese description (optional)

Self Check before Merge

  • 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

Additional Plan? (Optional if not new feature)

If this PR related with other PR or following info. You can type here.

@tangjinzhou
Copy link
Member

image
我们应该把 size omit 掉,组件的 size 已经和html原生特性有区别了

@tangjinzhou
Copy link
Member

@buqiyuan
Copy link
Member Author

嗯嗯 其实我一开始的时候也是把size给omit掉的,那现在是只omit掉size就可以了吗?还是omit(omitBy(inputProps, isUndefined), ['size'])这样,因为不确定是否还有与size`一样的情况

image

@buqiyuan
Copy link
Member Author

大概看了下input原生属性的标准,貌似只对size有严格要求,其他属性不规范的值都会被忽略,只omit掉size应该就可以了

@zhujunel
Copy link

+1

@LWD8
Copy link

LWD8 commented Apr 18, 2022

"vue": "^3.2.25", 这个版本有提示警告。升级到"vue": "^3.2.31"倒没问题了

@xianmxcv
Copy link

xianmxcv commented May 12, 2022

vue 3.2.31 ; antd3.2.0及以上还是会报warn,以前项目的antd3.1.0是正常的,现在从3.2降版到3.1还是会报

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

form input error
5 participants