{"action":"closed","number":127,"pull_request":{"url":"https://api.github.com/repos/r0man/sablono/pulls/127","id":78049446,"html_url":"https://github.com/r0man/sablono/pull/127","diff_url":"https://github.com/r0man/sablono/pull/127.diff","patch_url":"https://github.com/r0man/sablono/pull/127.patch","issue_url":"https://api.github.com/repos/r0man/sablono/issues/127","number":127,"state":"closed","locked":false,"title":"Fixed skipped keys in controlled components on IE","user":{"login":"tonsky","id":285292,"avatar_url":"https://avatars.githubusercontent.com/u/285292?v=3","gravatar_id":"","url":"https://api.github.com/users/tonsky","html_url":"https://github.com/tonsky","followers_url":"https://api.github.com/users/tonsky/followers","following_url":"https://api.github.com/users/tonsky/following{/other_user}","gists_url":"https://api.github.com/users/tonsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tonsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonsky/subscriptions","organizations_url":"https://api.github.com/users/tonsky/orgs","repos_url":"https://api.github.com/users/tonsky/repos","events_url":"https://api.github.com/users/tonsky/events{/privacy}","received_events_url":"https://api.github.com/users/tonsky/received_events","type":"User","site_admin":false},"body":"This PR fixes a problem when fast typing results in some keys gone missing in IE (even relatively contemporary IE 11)\r\n\r\nhttps://github.com/tonsky/rum/issues/86\r\nhttps://github.com/reagent-project/reagent/issues/253\r\n\r\nWhat happens is on IE `onChange` event is fired out of order, with a significant delay (not sure if it’s a React trying to “normalize” IE behaviour by polling it with a timeout or an actual IE problem). That causes problems with re-render happening on `requestAnimationFrame`.\r\n\r\nImagine a component:\r\n\r\n```clj\r\n(def *value (atom \"\"))\r\n\r\n(rum/defc comp < rum/reactive []\r\n  [:input {:type \"text\"\r\n           :value (rum/react *value)\r\n           :on-change (fn [e] (reset! *value (.. e -target -value)))}])\r\n```\r\n\r\nTypical order of events, if I type \"QW\" into the input:\r\n\r\n1. Keydown on `Q`\r\n2. Keydown on `W`\r\n3. Onchange fires with input.value = `Q`\r\n4. `on-change` callback is called, `*value` got reset to `Q`\r\n5. Re-rendering is _scheduled_\r\n6. In normal browsers, this is when second `on-change` should fire, setting `*value` to `QW` and causing no problems. Not on IE\r\n7. Animation frame happens and `comp` is re-rendered. Notice that the `*value` still holds `Q`, but actual value of input in DOM is `QW`. Second `on-change` has not fired yet, but value has already changed without us noticing it.\r\n8. React tries to render input and notices that we want to render `<input value=Q>` while on DOM it’s `<input value=QW>`. Diffing kicks in, React _resets_ value back to `Q`.\r\n9. Because of us tampering with DOM, second `on-change` never fires, cursor position got messed up, etc.\r\n\r\nThis patch changes wrapped components, adds detecting of this situation (onChange and actual DOM value disagreeing) and works around that.","created_at":"2016-07-19T21:08:34Z","updated_at":"2016-07-20T10:04:17Z","closed_at":"2016-07-20T10:04:17Z","merged_at":"2016-07-20T10:04:16Z","merge_commit_sha":"579f3d77271afd9edacc4fa0813f93ff42fe33a6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/r0man/sablono/pulls/127/commits","review_comments_url":"https://api.github.com/repos/r0man/sablono/pulls/127/comments","review_comment_url":"https://api.github.com/repos/r0man/sablono/pulls/comments{/number}","comments_url":"https://api.github.com/repos/r0man/sablono/issues/127/comments","statuses_url":"https://api.github.com/repos/r0man/sablono/statuses/f6be816a92236215b02e4707319db8e59e852b6d","head":{"label":"tonsky:master","ref":"master","sha":"f6be816a92236215b02e4707319db8e59e852b6d","user":{"login":"tonsky","id":285292,"avatar_url":"https://avatars.githubusercontent.com/u/285292?v=3","gravatar_id":"","url":"https://api.github.com/users/tonsky","html_url":"https://github.com/tonsky","followers_url":"https://api.github.com/users/tonsky/followers","following_url":"https://api.github.com/users/tonsky/following{/other_user}","gists_url":"https://api.github.com/users/tonsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tonsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonsky/subscriptions","organizations_url":"https://api.github.com/users/tonsky/orgs","repos_url":"https://api.github.com/users/tonsky/repos","events_url":"https://api.github.com/users/tonsky/events{/privacy}","received_events_url":"https://api.github.com/users/tonsky/received_events","type":"User","site_admin":false},"repo":{"id":51709488,"name":"sablono","full_name":"tonsky/sablono","owner":{"login":"tonsky","id":285292,"avatar_url":"https://avatars.githubusercontent.com/u/285292?v=3","gravatar_id":"","url":"https://api.github.com/users/tonsky","html_url":"https://github.com/tonsky","followers_url":"https://api.github.com/users/tonsky/followers","following_url":"https://api.github.com/users/tonsky/following{/other_user}","gists_url":"https://api.github.com/users/tonsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tonsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonsky/subscriptions","organizations_url":"https://api.github.com/users/tonsky/orgs","repos_url":"https://api.github.com/users/tonsky/repos","events_url":"https://api.github.com/users/tonsky/events{/privacy}","received_events_url":"https://api.github.com/users/tonsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tonsky/sablono","description":"Lisp/Hiccup style templating for Facebook's React in ClojureScript.","fork":true,"url":"https://api.github.com/repos/tonsky/sablono","forks_url":"https://api.github.com/repos/tonsky/sablono/forks","keys_url":"https://api.github.com/repos/tonsky/sablono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tonsky/sablono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tonsky/sablono/teams","hooks_url":"https://api.github.com/repos/tonsky/sablono/hooks","issue_events_url":"https://api.github.com/repos/tonsky/sablono/issues/events{/number}","events_url":"https://api.github.com/repos/tonsky/sablono/events","assignees_url":"https://api.github.com/repos/tonsky/sablono/assignees{/user}","branches_url":"https://api.github.com/repos/tonsky/sablono/branches{/branch}","tags_url":"https://api.github.com/repos/tonsky/sablono/tags","blobs_url":"https://api.github.com/repos/tonsky/sablono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tonsky/sablono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tonsky/sablono/git/refs{/sha}","trees_url":"https://api.github.com/repos/tonsky/sablono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tonsky/sablono/statuses/{sha}","languages_url":"https://api.github.com/repos/tonsky/sablono/languages","stargazers_url":"https://api.github.com/repos/tonsky/sablono/stargazers","contributors_url":"https://api.github.com/repos/tonsky/sablono/contributors","subscribers_url":"https://api.github.com/repos/tonsky/sablono/subscribers","subscription_url":"https://api.github.com/repos/tonsky/sablono/subscription","commits_url":"https://api.github.com/repos/tonsky/sablono/commits{/sha}","git_commits_url":"https://api.github.com/repos/tonsky/sablono/git/commits{/sha}","comments_url":"https://api.github.com/repos/tonsky/sablono/comments{/number}","issue_comment_url":"https://api.github.com/repos/tonsky/sablono/issues/comments{/number}","contents_url":"https://api.github.com/repos/tonsky/sablono/contents/{+path}","compare_url":"https://api.github.com/repos/tonsky/sablono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tonsky/sablono/merges","archive_url":"https://api.github.com/repos/tonsky/sablono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tonsky/sablono/downloads","issues_url":"https://api.github.com/repos/tonsky/sablono/issues{/number}","pulls_url":"https://api.github.com/repos/tonsky/sablono/pulls{/number}","milestones_url":"https://api.github.com/repos/tonsky/sablono/milestones{/number}","notifications_url":"https://api.github.com/repos/tonsky/sablono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tonsky/sablono/labels{/name}","releases_url":"https://api.github.com/repos/tonsky/sablono/releases{/id}","deployments_url":"https://api.github.com/repos/tonsky/sablono/deployments","created_at":"2016-02-14T19:24:10Z","updated_at":"2016-02-14T19:24:11Z","pushed_at":"2016-07-19T20:54:16Z","git_url":"git://github.com/tonsky/sablono.git","ssh_url":"git@github.com:tonsky/sablono.git","clone_url":"https://github.com/tonsky/sablono.git","svn_url":"https://github.com/tonsky/sablono","homepage":"","size":472,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"r0man:master","ref":"master","sha":"565c62c51424038c1c19b1a0d765674f74671fcf","user":{"login":"r0man","id":21566,"avatar_url":"https://avatars.githubusercontent.com/u/21566?v=3","gravatar_id":"","url":"https://api.github.com/users/r0man","html_url":"https://github.com/r0man","followers_url":"https://api.github.com/users/r0man/followers","following_url":"https://api.github.com/users/r0man/following{/other_user}","gists_url":"https://api.github.com/users/r0man/gists{/gist_id}","starred_url":"https://api.github.com/users/r0man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r0man/subscriptions","organizations_url":"https://api.github.com/users/r0man/orgs","repos_url":"https://api.github.com/users/r0man/repos","events_url":"https://api.github.com/users/r0man/events{/privacy}","received_events_url":"https://api.github.com/users/r0man/received_events","type":"User","site_admin":false},"repo":{"id":15357315,"name":"sablono","full_name":"r0man/sablono","owner":{"login":"r0man","id":21566,"avatar_url":"https://avatars.githubusercontent.com/u/21566?v=3","gravatar_id":"","url":"https://api.github.com/users/r0man","html_url":"https://github.com/r0man","followers_url":"https://api.github.com/users/r0man/followers","following_url":"https://api.github.com/users/r0man/following{/other_user}","gists_url":"https://api.github.com/users/r0man/gists{/gist_id}","starred_url":"https://api.github.com/users/r0man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r0man/subscriptions","organizations_url":"https://api.github.com/users/r0man/orgs","repos_url":"https://api.github.com/users/r0man/repos","events_url":"https://api.github.com/users/r0man/events{/privacy}","received_events_url":"https://api.github.com/users/r0man/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/r0man/sablono","description":"Lisp/Hiccup style templating for Facebook's React in ClojureScript.","fork":false,"url":"https://api.github.com/repos/r0man/sablono","forks_url":"https://api.github.com/repos/r0man/sablono/forks","keys_url":"https://api.github.com/repos/r0man/sablono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/r0man/sablono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/r0man/sablono/teams","hooks_url":"https://api.github.com/repos/r0man/sablono/hooks","issue_events_url":"https://api.github.com/repos/r0man/sablono/issues/events{/number}","events_url":"https://api.github.com/repos/r0man/sablono/events","assignees_url":"https://api.github.com/repos/r0man/sablono/assignees{/user}","branches_url":"https://api.github.com/repos/r0man/sablono/branches{/branch}","tags_url":"https://api.github.com/repos/r0man/sablono/tags","blobs_url":"https://api.github.com/repos/r0man/sablono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/r0man/sablono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/r0man/sablono/git/refs{/sha}","trees_url":"https://api.github.com/repos/r0man/sablono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/r0man/sablono/statuses/{sha}","languages_url":"https://api.github.com/repos/r0man/sablono/languages","stargazers_url":"https://api.github.com/repos/r0man/sablono/stargazers","contributors_url":"https://api.github.com/repos/r0man/sablono/contributors","subscribers_url":"https://api.github.com/repos/r0man/sablono/subscribers","subscription_url":"https://api.github.com/repos/r0man/sablono/subscription","commits_url":"https://api.github.com/repos/r0man/sablono/commits{/sha}","git_commits_url":"https://api.github.com/repos/r0man/sablono/git/commits{/sha}","comments_url":"https://api.github.com/repos/r0man/sablono/comments{/number}","issue_comment_url":"https://api.github.com/repos/r0man/sablono/issues/comments{/number}","contents_url":"https://api.github.com/repos/r0man/sablono/contents/{+path}","compare_url":"https://api.github.com/repos/r0man/sablono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/r0man/sablono/merges","archive_url":"https://api.github.com/repos/r0man/sablono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/r0man/sablono/downloads","issues_url":"https://api.github.com/repos/r0man/sablono/issues{/number}","pulls_url":"https://api.github.com/repos/r0man/sablono/pulls{/number}","milestones_url":"https://api.github.com/repos/r0man/sablono/milestones{/number}","notifications_url":"https://api.github.com/repos/r0man/sablono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/r0man/sablono/labels{/name}","releases_url":"https://api.github.com/repos/r0man/sablono/releases{/id}","deployments_url":"https://api.github.com/repos/r0man/sablono/deployments","created_at":"2013-12-21T10:29:21Z","updated_at":"2016-07-19T17:36:49Z","pushed_at":"2016-07-20T10:04:16Z","git_url":"git://github.com/r0man/sablono.git","ssh_url":"git@github.com:r0man/sablono.git","clone_url":"https://github.com/r0man/sablono.git","svn_url":"https://github.com/r0man/sablono","homepage":"","size":484,"stargazers_count":484,"watchers_count":484,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":8,"forks":39,"open_issues":8,"watchers":484,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/r0man/sablono/pulls/127"},"html":{"href":"https://github.com/r0man/sablono/pull/127"},"issue":{"href":"https://api.github.com/repos/r0man/sablono/issues/127"},"comments":{"href":"https://api.github.com/repos/r0man/sablono/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/r0man/sablono/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/r0man/sablono/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/r0man/sablono/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/r0man/sablono/statuses/f6be816a92236215b02e4707319db8e59e852b6d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"r0man","id":21566,"avatar_url":"https://avatars.githubusercontent.com/u/21566?v=3","gravatar_id":"","url":"https://api.github.com/users/r0man","html_url":"https://github.com/r0man","followers_url":"https://api.github.com/users/r0man/followers","following_url":"https://api.github.com/users/r0man/following{/other_user}","gists_url":"https://api.github.com/users/r0man/gists{/gist_id}","starred_url":"https://api.github.com/users/r0man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r0man/subscriptions","organizations_url":"https://api.github.com/users/r0man/orgs","repos_url":"https://api.github.com/users/r0man/repos","events_url":"https://api.github.com/users/r0man/events{/privacy}","received_events_url":"https://api.github.com/users/r0man/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":21,"deletions":9,"changed_files":1}}
{"actor":{"display_login":"r0man"}}