From 01cea9ad3d2f082ff155fd381a3a57157e020e18 Mon Sep 17 00:00:00 2001 From: vrde Date: Wed, 14 Oct 2015 15:30:10 +0200 Subject: [PATCH] Property component now propagate its name to its input child --- js/components/ascribe_forms/input_checkbox.js | 8 ++++++-- js/components/ascribe_forms/property.js | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/components/ascribe_forms/input_checkbox.js b/js/components/ascribe_forms/input_checkbox.js index 38885441..620c310f 100644 --- a/js/components/ascribe_forms/input_checkbox.js +++ b/js/components/ascribe_forms/input_checkbox.js @@ -17,11 +17,13 @@ let InputCheckbox = React.createClass({ // // Since this component even has checkbox in its name, it felt wrong to expose defaultValue // as the default-setting prop to other developers, which is why we choose defaultChecked. + defaultValue: React.PropTypes.string, defaultChecked: React.PropTypes.bool, children: React.PropTypes.oneOfType([ React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.element ]), + name: React.PropTypes.string, // provided by Property disabled: React.PropTypes.bool, @@ -102,8 +104,10 @@ let InputCheckbox = React.createClass({ return ( + onClick={this.onChange} + name={this.props.name}>