{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/12560","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/12560/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/12560/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/12560/events","html_url":"https://github.com/ant-design/ant-design/issues/12560","id":368145666,"node_id":"MDU6SXNzdWUzNjgxNDU2NjY=","number":12560,"title":"关于form表单动态验证问题","user":{"login":"xgj1988","id":8272614,"node_id":"MDQ6VXNlcjgyNzI2MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8272614?v=4","gravatar_id":"","url":"https://api.github.com/users/xgj1988","html_url":"https://github.com/xgj1988","followers_url":"https://api.github.com/users/xgj1988/followers","following_url":"https://api.github.com/users/xgj1988/following{/other_user}","gists_url":"https://api.github.com/users/xgj1988/gists{/gist_id}","starred_url":"https://api.github.com/users/xgj1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xgj1988/subscriptions","organizations_url":"https://api.github.com/users/xgj1988/orgs","repos_url":"https://api.github.com/users/xgj1988/repos","events_url":"https://api.github.com/users/xgj1988/events{/privacy}","received_events_url":"https://api.github.com/users/xgj1988/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"afc163","id":507615,"node_id":"MDQ6VXNlcjUwNzYxNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/507615?v=4","gravatar_id":"","url":"https://api.github.com/users/afc163","html_url":"https://github.com/afc163","followers_url":"https://api.github.com/users/afc163/followers","following_url":"https://api.github.com/users/afc163/following{/other_user}","gists_url":"https://api.github.com/users/afc163/gists{/gist_id}","starred_url":"https://api.github.com/users/afc163/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afc163/subscriptions","organizations_url":"https://api.github.com/users/afc163/orgs","repos_url":"https://api.github.com/users/afc163/repos","events_url":"https://api.github.com/users/afc163/events{/privacy}","received_events_url":"https://api.github.com/users/afc163/received_events","type":"User","site_admin":false},"assignees":[{"login":"afc163","id":507615,"node_id":"MDQ6VXNlcjUwNzYxNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/507615?v=4","gravatar_id":"","url":"https://api.github.com/users/afc163","html_url":"https://github.com/afc163","followers_url":"https://api.github.com/users/afc163/followers","following_url":"https://api.github.com/users/afc163/following{/other_user}","gists_url":"https://api.github.com/users/afc163/gists{/gist_id}","starred_url":"https://api.github.com/users/afc163/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afc163/subscriptions","organizations_url":"https://api.github.com/users/afc163/orgs","repos_url":"https://api.github.com/users/afc163/repos","events_url":"https://api.github.com/users/afc163/events{/privacy}","received_events_url":"https://api.github.com/users/afc163/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-10-09T10:35:12Z","updated_at":"2018-10-17T14:02:21Z","closed_at":"2018-10-15T11:57:09Z","author_association":"NONE","body":"- [ ] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.\r\n\r\n### Version\r\n3.10.0\r\n\r\n### Environment\r\nantd3.10.0 chrome 64.0.3282.186（正式版本） （64 位）\r\n\r\n### Reproduction link\r\n[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/wqkm0l503k)\r\n\r\n### Steps to reproduce\r\n先说明一下重现链接的问题，首先打开页面，有一个按钮，按钮会传递一个checkNick给一个Modal，但是我的Modal 又是根据 checkNick 的值来进行对age 和 nickname 两个输入框展示，然后两个输入框都要进行required true,，其实也就想要做的到是如果checkNick为true ，那么就只验证nickname，否者验证age，但是结果是age 不会渲染，但是也进行了验证。\r\n\r\n重现步骤\r\n1：点击按钮，弹出modal。\r\n2：在nickname输入框，输入内容。\r\n3：单击check按钮，这个时候会报please input age。但是age这个组件并没有。\r\n\r\n我换衣是第一次加载的时候会渲染出age，然后数据写入到form里面去了。后面就算重新render之后，虽然没有age 但是并不会从form里面移除，那么我的问题是如果手动移除。\r\n\r\n### What is expected?\r\n希望给一个移除API，或者form 能自己检测包括的组件是否已经有删除或者增加。\r\n\r\n### What is actually happening?\r\n出现没有显示的组件也会被验证。\r\n\r\n\r\n<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/430640842","html_url":"https://github.com/ant-design/ant-design/issues/12560#issuecomment-430640842","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/12560","id":430640842,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDY0MDg0Mg==","user":{"login":"zombieJ","id":5378891,"node_id":"MDQ6VXNlcjUzNzg4OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/5378891?v=4","gravatar_id":"","url":"https://api.github.com/users/zombieJ","html_url":"https://github.com/zombieJ","followers_url":"https://api.github.com/users/zombieJ/followers","following_url":"https://api.github.com/users/zombieJ/following{/other_user}","gists_url":"https://api.github.com/users/zombieJ/gists{/gist_id}","starred_url":"https://api.github.com/users/zombieJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zombieJ/subscriptions","organizations_url":"https://api.github.com/users/zombieJ/orgs","repos_url":"https://api.github.com/users/zombieJ/repos","events_url":"https://api.github.com/users/zombieJ/events{/privacy}","received_events_url":"https://api.github.com/users/zombieJ/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T14:02:21Z","updated_at":"2018-10-17T14:02:21Z","author_association":"MEMBER","body":"@TotooriaHyperion , \r\n之前这种不删除的行为是一个 bug。会导致如果注册的 field 存在 require 但是页面没有渲染这个 Field 导致 Form 验证无法通过。\r\n如果仍然想保留不渲染预置的效果，可以在 render 里调用一下 getFieldDecorator 注册一下。"}}
{"actor":{"display_login":"zombieJ"}}