From dfbf5a29b240627319611fadf27966a9d0a06b60 Mon Sep 17 00:00:00 2001 From: rickyham Date: Tue, 19 Jan 2016 15:10:55 +0000 Subject: [PATCH] Add success styling to form When an input is invalid the 'bsStyle' is set to error and produces visual feedback to the user. However the same is not true for successful inputs. Maybe there is a better way to do this, but I think this is really important. --- src/Form.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Form.js b/src/Form.js index 386a887..566640c 100644 --- a/src/Form.js +++ b/src/Form.js @@ -139,6 +139,8 @@ export default class Form extends InputContainer { } else if (child.props.errorHelp) { newProps.help = child.props.errorHelp; } + } else if(error === false && error !== undefined){ + newProps.bsStyle = 'success'; } return React.cloneElement(child, newProps);