Skip to content

Commit

Permalink
Use isNil to check the default value
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Mar 3, 2020
1 parent 438d2ff commit 19eac8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/app/components/dynamic-form/dynamicFormHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { each, includes, isUndefined, isEmpty, map } from "lodash";
import { each, includes, isUndefined, isEmpty, isNil, map } from "lodash";

function orderedInputs(properties, order, targetOptions) {
const inputs = new Array(order.length);
Expand All @@ -9,7 +9,7 @@ function orderedInputs(properties, order, targetOptions) {
name: key,
title: properties[key].title,
type: properties[key].type,
placeholder: (properties[key].default === false || properties[key].default) && properties[key].default.toString(),
placeholder: isNil(properties[key].default) ? null : properties[key].default.toString(),
required: properties[key].required,
extra: properties[key].extra,
initialValue: targetOptions[key],
Expand Down

0 comments on commit 19eac8b

Please sign in to comment.