From 5ffbdd67d23541f2bc33feae569bf7f2445ac154 Mon Sep 17 00:00:00 2001 From: James Lucas Date: Wed, 26 Oct 2022 16:28:43 +1100 Subject: [PATCH] A number attribute's value may be any Number including zero, cannot check existence of the value using ||, instead check if the value is NaN --- src/js/form-builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/form-builder.js b/src/js/form-builder.js index 3843abc43..287b9e270 100644 --- a/src/js/form-builder.js +++ b/src/js/form-builder.js @@ -882,7 +882,7 @@ function FormBuilder(opts, element, $) { */ const numberAttribute = (attribute, values) => { const { class: classname, className, value, ...attrs } = values - const attrVal = attrs[attribute] || value + const attrVal = (isNaN(attrs[attribute])) ? value : attrs[attribute] const attrLabel = mi18n.get(attribute) || attribute const placeholder = mi18n.get(`placeholder.${attribute}`)