{"action":"created","issue":{"url":"https://api.github.com/repos/riot/riot/issues/1642","repository_url":"https://api.github.com/repos/riot/riot","labels_url":"https://api.github.com/repos/riot/riot/issues/1642/labels{/name}","comments_url":"https://api.github.com/repos/riot/riot/issues/1642/comments","events_url":"https://api.github.com/repos/riot/riot/issues/1642/events","html_url":"https://github.com/riot/riot/issues/1642","id":138351010,"number":1642,"title":"Seeking community consensus on how updates to input expressions should function","user":{"login":"rsbondi","id":3729091,"avatar_url":"https://avatars.githubusercontent.com/u/3729091?v=3","gravatar_id":"","url":"https://api.github.com/users/rsbondi","html_url":"https://github.com/rsbondi","followers_url":"https://api.github.com/users/rsbondi/followers","following_url":"https://api.github.com/users/rsbondi/following{/other_user}","gists_url":"https://api.github.com/users/rsbondi/gists{/gist_id}","starred_url":"https://api.github.com/users/rsbondi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsbondi/subscriptions","organizations_url":"https://api.github.com/users/rsbondi/orgs","repos_url":"https://api.github.com/users/rsbondi/repos","events_url":"https://api.github.com/users/rsbondi/events{/privacy}","received_events_url":"https://api.github.com/users/rsbondi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/riot/riot/labels/discussion","name":"discussion","color":"ff44aa"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":33,"created_at":"2016-03-04T01:51:55Z","updated_at":"2016-08-27T16:04:50Z","closed_at":null,"body":"I am posting this to get feedback on how input expressions on update should be handled.  See further discussion at #1612 & #1638\r\n\r\n```xml\r\n<input value={expression} name=\"myInput\" onchange={changed}>\r\nthis.expression = \"initial value\"\r\n```\r\n\r\nThe riot functionality has been to evaluate `{expression}` with `\"initial value\"`.  On additional calls to `update`, `{expression}` will only be evaluated if the value of `this.expression` has changed.  The user can type freely into the input field but riot will not evaluate the expression on update as long as the value for `this.expression` has not changed.  A change of `this.expression` will then overwrite any user input on update. Additionally, you can manually sync the two like\r\n\r\n```javascript\r\nchanged() {\r\n  this.expression = myInput.value\r\n}\r\n```\r\nInterest has been shown suggesting that a different approach may be desired.  That would be to force a synchronized state by always evaluating the expression on update.  So the user types in values, but the expression will be evaluated on update returning the input field to `\"initial value\"` or whatever the current value is for `this.expression`  The dom updates would be limited by comparing the dom value to `this.expression`.  The above manual sync would be required to preserve the input value on update.  See more [here](http://blog.iansinnott.com/managing-state-and-controlled-form-fields-with-react/)\r\n\r\nPlease help us decide if we should keep the existing functionality in the 3.0 release or implement the alternate method"},"comment":{"url":"https://api.github.com/repos/riot/riot/issues/comments/242925501","html_url":"https://github.com/riot/riot/issues/1642#issuecomment-242925501","issue_url":"https://api.github.com/repos/riot/riot/issues/1642","id":242925501,"user":{"login":"willemmulder","id":70933,"avatar_url":"https://avatars.githubusercontent.com/u/70933?v=3","gravatar_id":"","url":"https://api.github.com/users/willemmulder","html_url":"https://github.com/willemmulder","followers_url":"https://api.github.com/users/willemmulder/followers","following_url":"https://api.github.com/users/willemmulder/following{/other_user}","gists_url":"https://api.github.com/users/willemmulder/gists{/gist_id}","starred_url":"https://api.github.com/users/willemmulder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willemmulder/subscriptions","organizations_url":"https://api.github.com/users/willemmulder/orgs","repos_url":"https://api.github.com/users/willemmulder/repos","events_url":"https://api.github.com/users/willemmulder/events{/privacy}","received_events_url":"https://api.github.com/users/willemmulder/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T16:04:50Z","updated_at":"2016-08-27T16:04:50Z","body":"@whatda yes we have the exact same problem. An attribute like <form refresh={isFresh}> would be perfect. Then if we set isFresh=true and subsequently call update(), all the containing input-fields would be refreshed from their bind-expressions. "}}
{"actor":{"display_login":"willemmulder"}}