mirror of
https://github.com/maputnik/editor.git
synced 2026-07-27 16:27:26 +00:00
Show default value in color field
This commit is contained in:
@@ -17,6 +17,7 @@ class ColorField extends React.Component {
|
|||||||
value: React.PropTypes.string,
|
value: React.PropTypes.string,
|
||||||
doc: React.PropTypes.string,
|
doc: React.PropTypes.string,
|
||||||
style: React.PropTypes.object,
|
style: React.PropTypes.object,
|
||||||
|
default: React.PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export default class SpecField extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const commonProps = {
|
const commonProps = {
|
||||||
style: this.props.style,
|
style: this.props.style,
|
||||||
|
default: this.props.fieldSpec.default,
|
||||||
value: this.props.value,
|
value: this.props.value,
|
||||||
name: this.props.fieldName,
|
name: this.props.fieldName,
|
||||||
onChange: newValue => this.props.onChange(this.props.fieldName, newValue)
|
onChange: newValue => this.props.onChange(this.props.fieldName, newValue)
|
||||||
@@ -59,7 +60,6 @@ export default class SpecField extends React.Component {
|
|||||||
case 'number': return (
|
case 'number': return (
|
||||||
<NumberInput
|
<NumberInput
|
||||||
{...commonProps}
|
{...commonProps}
|
||||||
default={this.props.fieldSpec.default}
|
|
||||||
min={this.props.fieldSpec.minimum}
|
min={this.props.fieldSpec.minimum}
|
||||||
max={this.props.fieldSpec.maximum}
|
max={this.props.fieldSpec.maximum}
|
||||||
/>
|
/>
|
||||||
@@ -98,7 +98,6 @@ export default class SpecField extends React.Component {
|
|||||||
{...commonProps}
|
{...commonProps}
|
||||||
type={this.props.fieldSpec.value}
|
type={this.props.fieldSpec.value}
|
||||||
length={this.props.fieldSpec.length}
|
length={this.props.fieldSpec.length}
|
||||||
default={this.props.fieldSpec.default}
|
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
default: return null
|
default: return null
|
||||||
|
|||||||
Reference in New Issue
Block a user