Skip to content

Commit

Permalink
fix: helpers.clearFields no longer supports an animate flag, update c…
Browse files Browse the repository at this point in the history
…alls to this function
  • Loading branch information
lucasnetau committed Sep 25, 2023
1 parent 42ddaa1 commit ec9aa51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ function FormBuilder(opts, element, $) {
formBuilder.actions = {
getFieldTypes: activeOnly =>
activeOnly ? subtract(controls.getRegistered(), opts.disableFields) : controls.getRegistered(),
clearFields: animate => h.removeAllFields(d.stage, animate),
clearFields: () => h.removeAllFields(d.stage),
showData: h.showData.bind(h),
save: minify => {
const formData = h.save(minify)
Expand All @@ -2442,7 +2442,7 @@ function FormBuilder(opts, element, $) {
getData: h.getFormData.bind(h),
setData: formData => {
h.stopIndex = undefined
h.removeAllFields(d.stage, false)
h.removeAllFields(d.stage)
loadFields(formData)
},
setLang: locale => {
Expand Down
5 changes: 2 additions & 3 deletions src/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,7 @@ export default class Helpers {

/**
* Removes all fields from the form
* @param {Object} stage to remove fields form
* @param {Boolean} animate whether to animate or not
* @param {HTMLElement} stage to remove fields form
* @return {void}
*/
removeAllFields(stage) {
Expand All @@ -719,7 +718,7 @@ export default class Helpers {
const markEmptyArray = []

if (!fields.length) {
return false
return
}

if (opts.prepend) {
Expand Down

0 comments on commit ec9aa51

Please sign in to comment.