{"action":"created","issue":{"url":"https://api.github.com/repos/r0man/sablono/issues/140","repository_url":"https://api.github.com/repos/r0man/sablono","labels_url":"https://api.github.com/repos/r0man/sablono/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/r0man/sablono/issues/140/comments","events_url":"https://api.github.com/repos/r0man/sablono/issues/140/events","html_url":"https://github.com/r0man/sablono/issues/140","id":197991552,"number":140,"title":"Input loses focus when initial value is `nil`","user":{"login":"roman01la","id":1355501,"avatar_url":"https://avatars.githubusercontent.com/u/1355501?v=3","gravatar_id":"","url":"https://api.github.com/users/roman01la","html_url":"https://github.com/roman01la","followers_url":"https://api.github.com/users/roman01la/followers","following_url":"https://api.github.com/users/roman01la/following{/other_user}","gists_url":"https://api.github.com/users/roman01la/gists{/gist_id}","starred_url":"https://api.github.com/users/roman01la/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman01la/subscriptions","organizations_url":"https://api.github.com/users/roman01la/orgs","repos_url":"https://api.github.com/users/roman01la/repos","events_url":"https://api.github.com/users/roman01la/events{/privacy}","received_events_url":"https://api.github.com/users/roman01la/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-29T11:14:23Z","updated_at":"2016-12-29T15:55:48Z","closed_at":null,"body":"I noticed that an input field loses focus on very first character typed in, when the initial value is `nil`. It works fine with an empty string.\r\n\r\nHere's a minimal reproducible example:\r\n```clj\r\n(ns app.core\r\n  (:require [sablono.core :as html :refer-macros [html]]))\r\n\r\n(def value (atom nil))\r\n\r\n(defn root [value]\r\n  (html\r\n   [:input {:value @value\r\n            :on-change #(reset! value (.. % -target -value))}]))\r\n\r\n(defn render [cmp]\r\n  (js/ReactDOM.render cmp (js/document.getElementById \"app\")))\r\n\r\n(render (root value))\r\n\r\n(add-watch value :input (fn [_ _ _ n] (render (root value))))\r\n```"},"comment":{"url":"https://api.github.com/repos/r0man/sablono/issues/comments/269649995","html_url":"https://github.com/r0man/sablono/issues/140#issuecomment-269649995","issue_url":"https://api.github.com/repos/r0man/sablono/issues/140","id":269649995,"user":{"login":"roman01la","id":1355501,"avatar_url":"https://avatars.githubusercontent.com/u/1355501?v=3","gravatar_id":"","url":"https://api.github.com/users/roman01la","html_url":"https://github.com/roman01la","followers_url":"https://api.github.com/users/roman01la/followers","following_url":"https://api.github.com/users/roman01la/following{/other_user}","gists_url":"https://api.github.com/users/roman01la/gists{/gist_id}","starred_url":"https://api.github.com/users/roman01la/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman01la/subscriptions","organizations_url":"https://api.github.com/users/roman01la/orgs","repos_url":"https://api.github.com/users/roman01la/repos","events_url":"https://api.github.com/users/roman01la/events{/privacy}","received_events_url":"https://api.github.com/users/roman01la/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T15:55:48Z","updated_at":"2016-12-29T15:55:48Z","body":"@r0man Interesting.. I just checked, in JavaScript the change from uncontrolled to controlled doesn't make input to loose focus http://jsbin.com/lurajaheko/edit?js,console,output"}}
{"actor":{"display_login":"roman01la"}}