diff --git a/packages/forms/src/components-control/form-utils/bind-form.ts b/packages/forms/src/components-control/form-utils/bind-form.ts index 53595f8..6cc5970 100644 --- a/packages/forms/src/components-control/form-utils/bind-form.ts +++ b/packages/forms/src/components-control/form-utils/bind-form.ts @@ -27,7 +27,8 @@ export class BindForm { private _plugins: IHTMLFormPlugin[]; - constructor(private _defaults?: (BindValues | (() => BindValues | Promise))) { + constructor(private _defaults?: BindValues) { + this.defaults(); this.initializePlugins(); } @@ -40,11 +41,7 @@ export class BindForm { } async defaults() { - if (typeof this._defaults === 'function') { - Object.assign(this, await (this._defaults as () => BindValues)()); - } else if (this._defaults) { - Object.assign(this, this._defaults); - } + Object.assign(this, this._defaults); } /** diff --git a/packages/forms/src/components/form/BindForm.astro b/packages/forms/src/components/form/BindForm.astro index 983acf3..cffe1fe 100644 --- a/packages/forms/src/components/form/BindForm.astro +++ b/packages/forms/src/components/form/BindForm.astro @@ -19,7 +19,6 @@ const haveState = await viewState.loadState(); await bind.on.stateLoaded?.(); if(!haveState){ - await bind.defaults(); await bind.on.newState?.(); } else { await bind.on.pagePostBack?.();