{"action":"closed","issue":{"url":"https://api.github.com/repos/mbrookes/formsy-material-ui/issues/110","repository_url":"https://api.github.com/repos/mbrookes/formsy-material-ui","labels_url":"https://api.github.com/repos/mbrookes/formsy-material-ui/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/mbrookes/formsy-material-ui/issues/110/comments","events_url":"https://api.github.com/repos/mbrookes/formsy-material-ui/issues/110/events","html_url":"https://github.com/mbrookes/formsy-material-ui/issues/110","id":158847904,"number":110,"title":"Update from props doesn't reflect in Date or Time fields","user":{"login":"solace","id":374583,"avatar_url":"https://avatars.githubusercontent.com/u/374583?v=3","gravatar_id":"","url":"https://api.github.com/users/solace","html_url":"https://github.com/solace","followers_url":"https://api.github.com/users/solace/followers","following_url":"https://api.github.com/users/solace/following{/other_user}","gists_url":"https://api.github.com/users/solace/gists{/gist_id}","starred_url":"https://api.github.com/users/solace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solace/subscriptions","organizations_url":"https://api.github.com/users/solace/orgs","repos_url":"https://api.github.com/users/solace/repos","events_url":"https://api.github.com/users/solace/events{/privacy}","received_events_url":"https://api.github.com/users/solace/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-07T06:21:44Z","updated_at":"2016-06-28T15:53:31Z","closed_at":"2016-06-28T15:53:31Z","body":"Hi,\r\n\r\nNot sure if I'm missing something essential here, but here's my use case.\r\n\r\nI have a parent component which contains the `Formsy` forms with a custom form element for array fields.  `handleOnChange` updates `rows` with a new array:\r\n```\r\n<Formsy.Form>\r\n    <ArrayFields rows={rows} onChange={handleOnChange} />\r\n</Formsy.Form>\r\n```\r\n\r\nArrayFields has a render that looks a bit like:\r\n```\r\ndoChange() {\r\n  const {rows, onChange} = this.props;\r\n  // update rows with changes\r\n  onChange(newRows);\r\n}\r\n\r\nrender() {\r\n    const {rows} = this.props;\r\n    console.log(rows);\r\n    return(\r\n        <div>\r\n            {rows.map((field, i) => (\r\n                <FormsyDate defaultDate={field.date} onChange={doChange} />\r\n                <Input type=\"date\" value={field.date ? moment(field.date).format('YYYY-MM-DD') : null}\r\n onChange={onChange} />\r\n            ))}\r\n        </div>\r\n    );\r\n}\r\n```\r\n\r\nThere are also add and remove buttons to manipulate the rows.  And I have added `Input` date to compare behaviours. \r\n\r\nOn first render, this populates the values correctly.  Adding rows and updating the fields works as expected.  But removing fields has an interesting problem:\r\n\r\nIf you have 3 rows, and remove row 2, `console.log` correctly dumps the remaining row 1 and 3, the `Input` fields correctly shows the appropriate values for 1 and 3, but the `FormsyDate` field shows the values for 1 and 2.\r\n\r\nFor further confirmation, updating the value using the `FormsyDate` picker reflects in the `Input`, but not vice versa.  So it appears as though `FormsyDate` doesn't reflect value updates unless you go through the picker mechanism.\r\n\r\nI have also tried using `defaultDate`, `defaultValue` and `value` for these fields separately and in combination, but it doesn't seem to update the display value for the Date (or Time) field.\r\n\r\nDo you have any suggestions for how I can get the change in value to reflect?\r\n\r\nThanks"}}
{"actor":{"display_login":"solace"}}