Skip to content

Commit

Permalink
A number attribute's value may be any Number including zero, cannot c…
Browse files Browse the repository at this point in the history
…heck existence of the value using ||, instead check if the value is NaN
  • Loading branch information
lucasnetau committed Oct 26, 2022
1 parent 013d0f9 commit 5ffbdd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)

Expand Down

0 comments on commit 5ffbdd6

Please sign in to comment.