{"action":"opened","issue":{"url":"https://api.github.com/repos/intellifactory/websharper.ui.next/issues/43","labels_url":"https://api.github.com/repos/intellifactory/websharper.ui.next/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/intellifactory/websharper.ui.next/issues/43/comments","events_url":"https://api.github.com/repos/intellifactory/websharper.ui.next/issues/43/events","html_url":"https://github.com/intellifactory/websharper.ui.next/issues/43","id":108626617,"number":43,"title":"It is not possible to register events on input that occur after the var has changed","user":{"login":"qwe2","id":1850930,"avatar_url":"https://avatars.githubusercontent.com/u/1850930?v=3","gravatar_id":"","url":"https://api.github.com/users/qwe2","html_url":"https://github.com/qwe2","followers_url":"https://api.github.com/users/qwe2/followers","following_url":"https://api.github.com/users/qwe2/following{/other_user}","gists_url":"https://api.github.com/users/qwe2/gists{/gist_id}","starred_url":"https://api.github.com/users/qwe2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qwe2/subscriptions","organizations_url":"https://api.github.com/users/qwe2/orgs","repos_url":"https://api.github.com/users/qwe2/repos","events_url":"https://api.github.com/users/qwe2/events{/privacy}","received_events_url":"https://api.github.com/users/qwe2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-28T10:06:49Z","updated_at":"2015-09-28T10:06:49Z","closed_at":null,"body":"The `Doc.Input` family currently uses the `keyup` event (due to IE8 compatibility) to change the value of the underlying `IRef`, which results in the user not being able to register any events that occur after the value of the `IRef` has changed. The order of the same events is not guaranteed by the spec. Probably should use `keypressed` instead if no compatibility issue arises.\r\n\r\n```fsharp\r\ntype IndexTemplate = Templating.Template<\"index.html\">\r\nlet Main =\r\n    let newName = Var.Create \"\"\r\n    IndexTemplate.Main.Doc(\r\n        Name = newName,\r\n        Add = (fun el ev ->\r\n            if ev?which = 13 then\r\n                Var.Set newName \"\"\r\n        )\r\n    )\r\n    |> Doc.RunById \"main\"\r\n```\r\n\r\nHere `newName` doesn't get to set to empty even if we use the `keyup` event to do it.\r\n\r\n"}}