{"action":"created","issue":{"url":"https://api.github.com/repos/infernojs/inferno/issues/1090","repository_url":"https://api.github.com/repos/infernojs/inferno","labels_url":"https://api.github.com/repos/infernojs/inferno/issues/1090/labels{/name}","comments_url":"https://api.github.com/repos/infernojs/inferno/issues/1090/comments","events_url":"https://api.github.com/repos/infernojs/inferno/issues/1090/events","html_url":"https://github.com/infernojs/inferno/issues/1090","id":230412735,"number":1090,"title":"Controlled inputs not behaving correctly (radio/checkbox)","user":{"login":"jpstevens","id":6638657,"avatar_url":"https://avatars2.githubusercontent.com/u/6638657?v=4","gravatar_id":"","url":"https://api.github.com/users/jpstevens","html_url":"https://github.com/jpstevens","followers_url":"https://api.github.com/users/jpstevens/followers","following_url":"https://api.github.com/users/jpstevens/following{/other_user}","gists_url":"https://api.github.com/users/jpstevens/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstevens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstevens/subscriptions","organizations_url":"https://api.github.com/users/jpstevens/orgs","repos_url":"https://api.github.com/users/jpstevens/repos","events_url":"https://api.github.com/users/jpstevens/events{/privacy}","received_events_url":"https://api.github.com/users/jpstevens/received_events","type":"User","site_admin":false},"labels":[{"id":172626685,"url":"https://api.github.com/repos/infernojs/inferno/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-05-22T14:24:07Z","updated_at":"2018-02-18T03:34:28Z","closed_at":"2017-06-01T20:06:23Z","author_association":"NONE","body":"For the following code snippet:\r\n\r\n```\r\n<label>\r\n  <input type='checkbox' checked={false} onChange={() => console.log('changed')} name='test' value='test' /> test\r\n</label>\r\n```\r\n\r\n**Observed Behaviour**\r\n\r\nClicking on the rendered checkbox changes it to be checked, even though the `checked` attribute is set to false.\r\n\r\n**Expected Current Behaviour**\r\n\r\nClicking on the above checkbox should **_not_** change it to be checked, as it is a controlled component (with the checked value always set to false).\r\n\r\nHere is an example of how it works in React: https://jsfiddle.net/69z2wepo/79218/\r\n\r\n**Inferno Metadata**\r\n\r\n- macOS + Chrome 58\r\n- App created w/ create-inferno-app, inferno@3.2.2\r\n"},"comment":{"url":"https://api.github.com/repos/infernojs/inferno/issues/comments/366490003","html_url":"https://github.com/infernojs/inferno/issues/1090#issuecomment-366490003","issue_url":"https://api.github.com/repos/infernojs/inferno/issues/1090","id":366490003,"user":{"login":"samsch","id":10436679,"avatar_url":"https://avatars0.githubusercontent.com/u/10436679?v=4","gravatar_id":"","url":"https://api.github.com/users/samsch","html_url":"https://github.com/samsch","followers_url":"https://api.github.com/users/samsch/followers","following_url":"https://api.github.com/users/samsch/following{/other_user}","gists_url":"https://api.github.com/users/samsch/gists{/gist_id}","starred_url":"https://api.github.com/users/samsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samsch/subscriptions","organizations_url":"https://api.github.com/users/samsch/orgs","repos_url":"https://api.github.com/users/samsch/repos","events_url":"https://api.github.com/users/samsch/events{/privacy}","received_events_url":"https://api.github.com/users/samsch/received_events","type":"User","site_admin":false},"created_at":"2018-02-18T03:34:28Z","updated_at":"2018-02-18T03:34:28Z","author_association":"NONE","body":"I think this is at least a related issue, if not the same, but in the 3.10.1 release, a text input with a value prop can still be changed, as if it was uncontrolled. It seems to be fixed in 4.0.3.\r\n\r\nSince that's not how it is (and was in v3) supposed to work (judging by current event-handing doc and previous version of the page), I'd normally just consider this a bug in an older version and not important, but this bug allows you to use onChange with a \"controlled\" input to have similar functionality to the way it works in React. So if you write as if using React's onChange (and don't actually need onInput-like functionality of state updates for every value change), then onChange \"works\" like it does in React.\r\n\r\nIt's an easy mistake to make when moving from (and \"thinking in\") React (I did it), which IMHO effectively makes this a breaking change from Inferno v3 to v4.\r\n\r\n[Can edit without value changing - repo](https://github.com/samsch/inferno-change-v3)\r\n[Can not edit in v4 - repo branch](https://github.com/samsch/inferno-change-v3/tree/working-v4)"}}
{"actor":{"display_login":"samsch"}}