Skip to content

Commit

Permalink
Merge pull request #1479 from lucasnetau/rowInit
Browse files Browse the repository at this point in the history
Set default floor for numerical row index
  • Loading branch information
lucasnetau authored Nov 1, 2023
2 parents 8ebd4be + e963748 commit 20bd713
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 @@ -1479,7 +1479,7 @@ function FormBuilder(opts, element, $) {
nextRow = 1
} else {
const numericalRows = formRows.filter(value => !isNaN(value) && !isNaN(parseInt(value))).map(str => parseInt(str))
nextRow = (Math.max(...numericalRows) + 1)
nextRow = (Math.max(...numericalRows, 0) + 1)
}

result.rowUniqueId = nextRow.toString()
Expand Down

0 comments on commit 20bd713

Please sign in to comment.