{"action":"created","issue":{"url":"https://api.github.com/repos/kettanaito/react-advanced-form/issues/113","repository_url":"https://api.github.com/repos/kettanaito/react-advanced-form","labels_url":"https://api.github.com/repos/kettanaito/react-advanced-form/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/kettanaito/react-advanced-form/issues/113/comments","events_url":"https://api.github.com/repos/kettanaito/react-advanced-form/issues/113/events","html_url":"https://github.com/kettanaito/react-advanced-form/issues/113","id":283249051,"number":113,"title":"Bug: Initial value of dynamic \"required\" is wrong","user":{"login":"kettanaito","id":14984911,"avatar_url":"https://avatars3.githubusercontent.com/u/14984911?v=4","gravatar_id":"","url":"https://api.github.com/users/kettanaito","html_url":"https://github.com/kettanaito","followers_url":"https://api.github.com/users/kettanaito/followers","following_url":"https://api.github.com/users/kettanaito/following{/other_user}","gists_url":"https://api.github.com/users/kettanaito/gists{/gist_id}","starred_url":"https://api.github.com/users/kettanaito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kettanaito/subscriptions","organizations_url":"https://api.github.com/users/kettanaito/orgs","repos_url":"https://api.github.com/users/kettanaito/repos","events_url":"https://api.github.com/users/kettanaito/events{/privacy}","received_events_url":"https://api.github.com/users/kettanaito/received_events","type":"User","site_admin":false},"labels":[{"id":699817922,"url":"https://api.github.com/repos/kettanaito/react-advanced-form/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kettanaito/react-advanced-form/milestones/1","html_url":"https://github.com/kettanaito/react-advanced-form/milestone/1","labels_url":"https://api.github.com/repos/kettanaito/react-advanced-form/milestones/1/labels","id":2934017,"number":1,"title":"Release 1.0","description":"","creator":{"login":"kettanaito","id":14984911,"avatar_url":"https://avatars3.githubusercontent.com/u/14984911?v=4","gravatar_id":"","url":"https://api.github.com/users/kettanaito","html_url":"https://github.com/kettanaito","followers_url":"https://api.github.com/users/kettanaito/followers","following_url":"https://api.github.com/users/kettanaito/following{/other_user}","gists_url":"https://api.github.com/users/kettanaito/gists{/gist_id}","starred_url":"https://api.github.com/users/kettanaito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kettanaito/subscriptions","organizations_url":"https://api.github.com/users/kettanaito/orgs","repos_url":"https://api.github.com/users/kettanaito/repos","events_url":"https://api.github.com/users/kettanaito/events{/privacy}","received_events_url":"https://api.github.com/users/kettanaito/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":124,"state":"open","created_at":"2017-11-23T16:59:49Z","updated_at":"2018-02-11T11:34:28Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-12-19T14:29:13Z","updated_at":"2018-02-11T12:17:06Z","closed_at":null,"author_association":"OWNER","body":"## What\r\nThe initial value of dynamic `required` Field prop is wrong. Once interacted with the form (means executing that dynamic fields iteration and updating) it becomes correct.\r\n\r\n## Why\r\nMost likely, because there is no initial dynamic fields update on construction/registration.\r\n\r\n## How\r\n```jsx\r\n<Form>\r\n            <Input\r\n              type=\"email\"\r\n              name=\"username\"\r\n              label=\"Username\"\r\n              required />\r\n\r\n            <Input\r\n              type=\"password\"\r\n              label=\"Password\"\r\n              name=\"password\"\r\n              required />\r\n\r\n            <Input\r\n              name=\"firstName\"\r\n              label=\"First name\" />\r\n            \r\n            <Input\r\n              name=\"lastName\"\r\n              label=\"First name\"\r\n              required={({ fields }) => {\r\n                return fields.firstName && !!fields.firstName.value; // this is \"true\" on initial load\r\n              }} />\r\n\r\n            <button\r\n              className=\"btn btn-primary\"\r\n              type=\"submit\">\r\n              Create a new account\r\n            </button>\r\n          </Form>\r\n```\r\nConsider the layout above. Try to submit the form without touching anything. \"lastName\" field will be marked as `missing`, although it should not be required at all."},"comment":{"url":"https://api.github.com/repos/kettanaito/react-advanced-form/issues/comments/364747210","html_url":"https://github.com/kettanaito/react-advanced-form/issues/113#issuecomment-364747210","issue_url":"https://api.github.com/repos/kettanaito/react-advanced-form/issues/113","id":364747210,"user":{"login":"kettanaito","id":14984911,"avatar_url":"https://avatars3.githubusercontent.com/u/14984911?v=4","gravatar_id":"","url":"https://api.github.com/users/kettanaito","html_url":"https://github.com/kettanaito","followers_url":"https://api.github.com/users/kettanaito/followers","following_url":"https://api.github.com/users/kettanaito/following{/other_user}","gists_url":"https://api.github.com/users/kettanaito/gists{/gist_id}","starred_url":"https://api.github.com/users/kettanaito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kettanaito/subscriptions","organizations_url":"https://api.github.com/users/kettanaito/orgs","repos_url":"https://api.github.com/users/kettanaito/repos","events_url":"https://api.github.com/users/kettanaito/events{/privacy}","received_events_url":"https://api.github.com/users/kettanaito/received_events","type":"User","site_admin":false},"created_at":"2018-02-11T12:17:06Z","updated_at":"2018-02-11T12:17:06Z","author_association":"OWNER","body":"This is related to #24, and has a high chance to be fixed under that issue."}}
{"actor":{"display_login":"kettanaito"}}