fix(widgets): fix list object field default values (#1826)
This commit is contained in:
committed by
Shawn Erquhart
parent
a9f69f9ddc
commit
c765793971
@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import styled from 'react-emotion';
|
||||
import { isBoolean } from 'lodash';
|
||||
import { Toggle, ToggleBackground, colors } from 'netlify-cms-ui-default';
|
||||
|
||||
const BooleanBackground = styled(ToggleBackground)`
|
||||
@ -13,7 +12,6 @@ export default class BooleanControl extends React.Component {
|
||||
render() {
|
||||
const {
|
||||
value,
|
||||
field,
|
||||
forID,
|
||||
onChange,
|
||||
classNameWrapper,
|
||||
@ -24,7 +22,7 @@ export default class BooleanControl extends React.Component {
|
||||
<div className={classNameWrapper}>
|
||||
<Toggle
|
||||
id={forID}
|
||||
active={isBoolean(value) ? value : field.get('defaultValue', false)}
|
||||
active={value}
|
||||
onChange={onChange}
|
||||
onFocus={setActiveStyle}
|
||||
onBlur={setInactiveStyle}
|
||||
|
Reference in New Issue
Block a user