Skip to content

Commit caf2837

Browse files
Avocherautofix-ci[bot]
andauthoredMar 20, 2025··
fix(lit-form): initialize api before adding controller (#1254)
* fix(lit-form): initialize api before adding controller * ci: apply automated fixes and generate docs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent f8348e3 commit caf2837

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
 

‎docs/framework/lit/reference/classes/tanstackformcontroller.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Defined in: [tanstack-form-controller.ts:206](https://github.com/TanStack/form/b
7777
field<TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>(fieldConfig, render): object
7878
```
7979
80-
Defined in: [tanstack-form-controller.ts:260](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L260)
80+
Defined in: [tanstack-form-controller.ts:259](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L259)
8181
8282
#### Type Parameters
8383
@@ -145,7 +145,7 @@ render: renderCallback<TParentData, TName, TData, TOnMount, TOnChange, TOnChange
145145
hostConnected(): void
146146
```
147147
148-
Defined in: [tanstack-form-controller.ts:250](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L250)
148+
Defined in: [tanstack-form-controller.ts:249](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L249)
149149
150150
Called when the host is connected to the component tree. For custom
151151
element hosts, this corresponds to the `connectedCallback()` lifecycle,
@@ -169,7 +169,7 @@ ReactiveController.hostConnected
169169
hostDisconnected(): void
170170
```
171171
172-
Defined in: [tanstack-form-controller.ts:256](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L256)
172+
Defined in: [tanstack-form-controller.ts:255](https://github.com/TanStack/form/blob/main/packages/lit-form/src/tanstack-form-controller.ts#L255)
173173
174174
Called when the host is disconnected from the component tree. For custom
175175
element hosts, this corresponds to the `disconnectedCallback()` lifecycle,

‎packages/lit-form/src/tanstack-form-controller.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ export class TanStackFormController<
231231
TSubmitMeta
232232
>,
233233
) {
234-
;(this.#host = host).addController(this)
235-
236234
this.api = new FormApi<
237235
TParentData,
238236
TFormOnMount,
@@ -245,6 +243,7 @@ export class TanStackFormController<
245243
TFormOnServer,
246244
TSubmitMeta
247245
>(config)
246+
;(this.#host = host).addController(this)
248247
}
249248

250249
hostConnected() {

0 commit comments

Comments
 (0)
Please sign in to comment.