Skip to content

Commit

Permalink
fix: If no value was set for a numberAttribute the value attribute's …
Browse files Browse the repository at this point in the history
…value was used instead. This causes min/max/step/rows/maxLen number attributes to incorrectly be assigned a value if they are not set in formData but a number exists in the value attribute
  • Loading branch information
lucasnetau committed Aug 23, 2023
1 parent 58baf4e commit 28b1a6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,8 @@ function FormBuilder(opts, element, $) {
* @return {String} markup for number attribute
*/
const numberAttribute = (attribute, values) => {
const { class: classname, className, value, ...attrs } = values
const attrVal = (isNaN(attrs[attribute])) ? value : attrs[attribute]
const { class: classname, className, ...attrs } = values
const attrVal = (isNaN(attrs[attribute])) ? undefined : attrs[attribute]
const attrLabel = mi18n.get(attribute) || attribute
const placeholder = mi18n.get(`placeholder.${attribute}`)

Expand Down

0 comments on commit 28b1a6f

Please sign in to comment.