Skip to content

Commit

Permalink
fix: formRender api
Browse files Browse the repository at this point in the history
resolves #1279
  • Loading branch information
kevinchappell committed Mar 25, 2022
1 parent d115d0a commit 05a3476
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/form-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class FormRender {
methods.instance = new FormRender(options)
forms.each(index => methods.instance.render(forms[index], index))

return { ...methods.instance, ...methods }
return methods.instance
},
userData: () => methods.instance && methods.instance.userData,
clear: () => methods.instance && methods.instance.clear(),
Expand All @@ -370,7 +370,9 @@ class FormRender {
if (methods[methodOrOptions]) {
return methods[methodOrOptions].apply(this, args)
} else {
return methods.init(this, methodOrOptions)
const instance = methods.init(this, methodOrOptions)
Object.assign(methods, instance)
return instance
}
}

Expand Down

0 comments on commit 05a3476

Please sign in to comment.