{"action":"created","issue":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/3420","labels_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/3420/labels{/name}","comments_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/3420/comments","events_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/3420/events","html_url":"https://github.com/adobe-photoshop/spaces-design/pull/3420","id":121559138,"number":3420,"title":"Better way to handle empty value in TextInput","user":{"login":"shaoshing","id":118264,"avatar_url":"https://avatars.githubusercontent.com/u/118264?v=3","gravatar_id":"","url":"https://api.github.com/users/shaoshing","html_url":"https://github.com/shaoshing","followers_url":"https://api.github.com/users/shaoshing/followers","following_url":"https://api.github.com/users/shaoshing/following{/other_user}","gists_url":"https://api.github.com/users/shaoshing/gists{/gist_id}","starred_url":"https://api.github.com/users/shaoshing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaoshing/subscriptions","organizations_url":"https://api.github.com/users/shaoshing/orgs","repos_url":"https://api.github.com/users/shaoshing/repos","events_url":"https://api.github.com/users/shaoshing/events{/privacy}","received_events_url":"https://api.github.com/users/shaoshing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-10T19:25:01Z","updated_at":"2015-12-10T19:32:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/3420","html_url":"https://github.com/adobe-photoshop/spaces-design/pull/3420","diff_url":"https://github.com/adobe-photoshop/spaces-design/pull/3420.diff","patch_url":"https://github.com/adobe-photoshop/spaces-design/pull/3420.patch"},"body":"* Instead of handling empty value in the handler, I added new option `allowEmpty` which will ignore empty value and skip the `onChange` handler.\r\n* `onChange` was not clear before: it could be onChange handler or onCommit handler (when `continuous` prop is true). I reduce its scope by adding a new handle `onInputChange`, which also helps remove the `continuous` prop. Please see doc for difference of two handlers.\r\n* bug fix: disallow empty value in ColorPicker. Otherwise inputting empty value will set color to black.\r\n\r\n@volfied @mcilroyc can you review since you both reviewed #3410 ?"},"comment":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/comments/163727151","html_url":"https://github.com/adobe-photoshop/spaces-design/pull/3420#issuecomment-163727151","issue_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/3420","id":163727151,"user":{"login":"mcilroyc","id":1168110,"avatar_url":"https://avatars.githubusercontent.com/u/1168110?v=3","gravatar_id":"","url":"https://api.github.com/users/mcilroyc","html_url":"https://github.com/mcilroyc","followers_url":"https://api.github.com/users/mcilroyc/followers","following_url":"https://api.github.com/users/mcilroyc/following{/other_user}","gists_url":"https://api.github.com/users/mcilroyc/gists{/gist_id}","starred_url":"https://api.github.com/users/mcilroyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcilroyc/subscriptions","organizations_url":"https://api.github.com/users/mcilroyc/orgs","repos_url":"https://api.github.com/users/mcilroyc/repos","events_url":"https://api.github.com/users/mcilroyc/events{/privacy}","received_events_url":"https://api.github.com/users/mcilroyc/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T19:32:58Z","updated_at":"2015-12-10T19:32:58Z","body":"Another high level comment: I feel like maybe the \"allowEmpty\" concept is too narrow.  Can we just find a good pattern for letting the parent's \"onChange\" handler do the right thing, or provide \"validation\" feedback so that future situations can be handled similarly without having to stuff more \"pre validation\" into Text Input.  "}}