From 384b2d4bea8e420fd84ee2561d07ac434b1cef80 Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 30 Dec 2016 17:16:58 +0100 Subject: [PATCH] Show default value in color field --- src/components/fields/ColorField.jsx | 1 + src/components/fields/SpecField.jsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/fields/ColorField.jsx b/src/components/fields/ColorField.jsx index a58a52b..9a89777 100644 --- a/src/components/fields/ColorField.jsx +++ b/src/components/fields/ColorField.jsx @@ -17,6 +17,7 @@ class ColorField extends React.Component { value: React.PropTypes.string, doc: React.PropTypes.string, style: React.PropTypes.object, + default: React.PropTypes.string, } constructor(props) { diff --git a/src/components/fields/SpecField.jsx b/src/components/fields/SpecField.jsx index 7f46bf4..153467e 100644 --- a/src/components/fields/SpecField.jsx +++ b/src/components/fields/SpecField.jsx @@ -51,6 +51,7 @@ export default class SpecField extends React.Component { render() { const commonProps = { style: this.props.style, + default: this.props.fieldSpec.default, value: this.props.value, name: this.props.fieldName, onChange: newValue => this.props.onChange(this.props.fieldName, newValue) @@ -59,7 +60,6 @@ export default class SpecField extends React.Component { case 'number': return ( @@ -98,7 +98,6 @@ export default class SpecField extends React.Component { {...commonProps} type={this.props.fieldSpec.value} length={this.props.fieldSpec.length} - default={this.props.fieldSpec.default} /> ) default: return null