{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/5680","labels_url":"https://api.github.com/repos/facebook/react/issues/5680/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/5680/comments","events_url":"https://api.github.com/repos/facebook/react/issues/5680/events","html_url":"https://github.com/facebook/react/pull/5680","id":122610438,"number":5680,"title":"Set value by setAttribute(value) for html input box for #4618","user":{"login":"hayesgm","id":271024,"avatar_url":"https://avatars.githubusercontent.com/u/271024?v=3","gravatar_id":"","url":"https://api.github.com/users/hayesgm","html_url":"https://github.com/hayesgm","followers_url":"https://api.github.com/users/hayesgm/followers","following_url":"https://api.github.com/users/hayesgm/following{/other_user}","gists_url":"https://api.github.com/users/hayesgm/gists{/gist_id}","starred_url":"https://api.github.com/users/hayesgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayesgm/subscriptions","organizations_url":"https://api.github.com/users/hayesgm/orgs","repos_url":"https://api.github.com/users/hayesgm/repos","events_url":"https://api.github.com/users/hayesgm/events{/privacy}","received_events_url":"https://api.github.com/users/hayesgm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-12-16T21:49:31Z","updated_at":"2016-01-13T00:51:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react/pulls/5680","html_url":"https://github.com/facebook/react/pull/5680","diff_url":"https://github.com/facebook/react/pull/5680.diff","patch_url":"https://github.com/facebook/react/pull/5680.patch"},"body":"This is an alternate approach for #5666, using `setAttribute(value)` instead of `defaultValue` as a DOM property. Both this and #5666 are fixes for #4618 and are mutually exclusive approaches.\r\n\r\nFixes issue #4618, which allows updates to defaultValue on uncontrolled <input>s by changing `element.value` via `element.setAttribute(value)`. We move `hasSideEffects` code into the input and textarea wrappers (each wrapper updates still via `element.value = ...`). Browsers will reflect changes to `setValue(value)` on `<input>` elements unless the user has adjusted the value on an uncontrolled element. This is the approach suggested by @spicyj. \r\n\r\nNote: even after this patch, changes to defaultValue on textarea and select elements will not be reflected after the component is mounted.\r\n\r\nHere's a simple test of the patch on JSBin: https://jsbin.com/tobuye/10/edit?html,js,output"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/171114099","html_url":"https://github.com/facebook/react/pull/5680#issuecomment-171114099","issue_url":"https://api.github.com/repos/facebook/react/issues/5680","id":171114099,"user":{"login":"hayesgm","id":271024,"avatar_url":"https://avatars.githubusercontent.com/u/271024?v=3","gravatar_id":"","url":"https://api.github.com/users/hayesgm","html_url":"https://github.com/hayesgm","followers_url":"https://api.github.com/users/hayesgm/followers","following_url":"https://api.github.com/users/hayesgm/following{/other_user}","gists_url":"https://api.github.com/users/hayesgm/gists{/gist_id}","starred_url":"https://api.github.com/users/hayesgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayesgm/subscriptions","organizations_url":"https://api.github.com/users/hayesgm/orgs","repos_url":"https://api.github.com/users/hayesgm/repos","events_url":"https://api.github.com/users/hayesgm/events{/privacy}","received_events_url":"https://api.github.com/users/hayesgm/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T00:51:25Z","updated_at":"2016-01-13T00:51:25Z","body":"@jimfb I'll get this rebased / take care of the small issues you raised. Not really sure where we stand on this PR, however."}}