react-component / form

React High Order Form Component(web & react-native)
http://react-component.github.io/form/
MIT License
1.81k stars 296 forks source link

reset fields dirty for re-check #238

Closed zombieJ closed 5 years ago

zombieJ commented 5 years ago

ref: https://github.com/ant-design/ant-design/issues/13689

This may no need use set force in validate anymore.

yyfearth commented 5 years ago

I think this is a breaking change. This means every validateFields become force: true, if run getFieldDecorator with rules during render. Currently we have some validator runs only when field is dirty (after change). But after this, that field always dirty, and validator will execute no mater field really changed or not.

zombieJ commented 5 years ago

I think this is a breaking change...

This setFieldsAsDirty is called when user change any of the field value. It won't called on getFieldDecorator. This patch is aim to fix some field rule has connection. Like field 1 value validate rule is base of field 2 value. When user change field 2, field 1 should re-check again.