From 3f9ce47c84919ec1a07bb156909093adea6c16a5 Mon Sep 17 00:00:00 2001 From: Benoit Genevaux Date: Tue, 12 Dec 2017 18:35:48 +0100 Subject: [PATCH] Fix of uncontrolled input When ```undefined``` is passed as the ```checked``` props of the input, this one is considered as uncontrolled, and an uncontrolled component sometimes cannot change its value via React, resulting in an input which changes cannot be controlled by focus. Passing ```''``` instead of ```undefined``` fix this error. --- src/components/input/radio/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/input/radio/index.js b/src/components/input/radio/index.js index a0e094881..5e4ae81e9 100644 --- a/src/components/input/radio/index.js +++ b/src/components/input/radio/index.js @@ -77,7 +77,7 @@ class Radio extends Component { const validInputProps = filterProps(this.props); validInputProps.onChange = this._onChange; - validInputProps.checked = isChecked ? 'checked' : undefined; + validInputProps.checked = isChecked ? 'checked' : ''; const inputProps = { ...validInputProps }; return (