{"action":"closed","issue":{"url":"https://api.github.com/repos/prometheusresearch/react-forms/issues/121","repository_url":"https://api.github.com/repos/prometheusresearch/react-forms","labels_url":"https://api.github.com/repos/prometheusresearch/react-forms/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/prometheusresearch/react-forms/issues/121/comments","events_url":"https://api.github.com/repos/prometheusresearch/react-forms/issues/121/events","html_url":"https://github.com/prometheusresearch/react-forms/issues/121","id":133598440,"number":121,"title":"Empty value = undefined vs empty string vs null","user":{"login":"ifunk","id":30913,"avatar_url":"https://avatars.githubusercontent.com/u/30913?v=3","gravatar_id":"","url":"https://api.github.com/users/ifunk","html_url":"https://github.com/ifunk","followers_url":"https://api.github.com/users/ifunk/followers","following_url":"https://api.github.com/users/ifunk/following{/other_user}","gists_url":"https://api.github.com/users/ifunk/gists{/gist_id}","starred_url":"https://api.github.com/users/ifunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifunk/subscriptions","organizations_url":"https://api.github.com/users/ifunk/orgs","repos_url":"https://api.github.com/users/ifunk/repos","events_url":"https://api.github.com/users/ifunk/events{/privacy}","received_events_url":"https://api.github.com/users/ifunk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-15T00:52:04Z","updated_at":"2016-02-15T10:34:43Z","closed_at":"2016-02-15T10:34:43Z","body":"Was testing beta10 and noticed a bug, when removing all the text from an input, the value is re-populated on blur.\r\n\r\nI'm guessing this is because of \r\n\r\n```\r\nif (value === '') {\r\n    value = undefined;\r\n}\r\n```\r\n\r\nand\r\n\r\n```\r\nthis.props.onBlur(e);\r\nif (this._expectedValue !== undefined) {\r\n    this._finalizeOnChange();\r\n    this._cancelOnChange();\r\n}\r\n```\r\n\r\nIn addition, I have been using beta4 with my app and had some issues with the automatic conversion of '' to undefined. Maybe it was the ajax library I was using, however having a value as undefined caused the value to be ignored when sending the ajax request. I decided to use a custom Field to get around this logic.\r\n\r\nSince empty string doesn't equal undefined (if anything, it's more comparable to null) maybe the validation logic can be changed rather than modifying the value? Or possibly normalize it to null instead (not sure if there any side-effects of this)."}}