display NaN values as undefined

Summary: NaN values now display a placeholder saying undefined.

Reviewed By: emilsjolander

Differential Revision: D7009509

fbshipit-source-id: a3af360cc5c9d93e95a9e10368270f053a9b2c08
This commit is contained in:
Daniel Büchele
2018-02-16 05:47:31 -08:00
committed by Facebook Github Bot
parent 7f99a547f5
commit 01ffe10c2f
2 changed files with 3 additions and 5 deletions

View File

@@ -35,6 +35,8 @@ export default (props: Props<*>) => {
type="text" type="text"
{...props} {...props}
onChange={e => props.onChange(props.property, e.target.value)} onChange={e => props.onChange(props.property, e.target.value)}
placeholder="undefined"
value={Number.isNaN(props.value) ? '' : props.value}
/> />
); );
} }

View File

@@ -149,11 +149,7 @@ export default class Playground extends Component<Props, State> {
const updatedChildren = layoutDefinition const updatedChildren = layoutDefinition
.getIn(path) .getIn(path)
.push(LayoutRecord({width: 100, height: 100})); .push(LayoutRecord({width: 100, height: 100}));
this.modifyAtPath( this.modifyAtPath(path, updatedChildren);
path,
updatedChildren,
selectedNodePath.concat(updatedChildren.size - 1),
);
} }
}; };