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

Counter在FormItem设置为required,进行表单验证时错误提示xxx is required #1842

Closed
s952787097 opened this issue Jul 20, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@s952787097
Copy link

s952787097 commented Jul 20, 2021

Bug 描述
Form表单必填验证 Counter的父元素FormItem设置为必填项
设置Counter默认值或给表单ref属性设置默认值校验
依旧提示xxx is required

参考
重现步骤:

  1. 使用Form、FormItem、Counter、Button组件
  2. 给FormItem加上required字段并设置为true即校验counter为必填项
  3. Button按钮点击方法中实现表单校验
  4. 点击按钮
  5. Counter下方【会】提示xxx is required

预期行为
Counter下方【不会】提示xxx is required

截屏
image

可重现环境:

  • 系统: macOS
  • 浏览器:Chrome
  • HIUI 的版本: 3.7.0

临时解决方案
重写覆盖当前的FormItem的rules属性并实现其中的validator方法调用cb()跳过验证

@s952787097 s952787097 added the bug Something isn't working label Jul 20, 2021
solarjoker added a commit that referenced this issue Aug 9, 2021
@Flcwl Flcwl mentioned this issue Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant