Skip to content

Commit cd29b29

Browse files
committed
Add export and improve code of submit method #136
1 parent c06f929 commit cd29b29

File tree

12 files changed

+16
-11
lines changed

12 files changed

+16
-11
lines changed

packages/preact/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to the library will be documented in this file.
44

55
## vX.X.X (Month DD, YYYY)
66

7-
- Add `submit` method (issue #130)
7+
- Add `submit` method (issue #130, pull request #136)
88

99
## v0.6.2 (August 23, 2023)
1010

packages/preact/src/methods/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export * from './setError';
1616
export * from './setResponse';
1717
export * from './setValue';
1818
export * from './setValues';
19+
export * from './submit';
1920
export * from './swap';
2021
export * from './validate';

packages/preact/src/methods/submit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type { FieldValues, FormStore, ResponseData } from '../types';
33
/**
44
* Validates and submits the form.
55
*
6-
* @param form The form to be validated and submitted.
6+
* @param form The form to be submitted.
77
*/
88
export function submit<
99
TFieldValues extends FieldValues,
1010
TResponseData extends ResponseData
1111
>(form: FormStore<TFieldValues, TResponseData>): void {
12-
form.element.value?.requestSubmit();
12+
form.element.peek()?.requestSubmit();
1313
}

packages/qwik/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to the library will be documented in this file.
44

55
## vX.X.X (Month DD, YYYY)
66

7-
- Add `submit` method (issue #130)
7+
- Add `submit` method (issue #130, pull request #136)
88

99
## v0.20.2 (August 23, 2023)
1010

packages/qwik/src/methods/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export * from './setError';
1616
export * from './setResponse';
1717
export * from './setValue';
1818
export * from './setValues';
19+
export * from './submit';
1920
export * from './swap';
2021
export * from './validate';

packages/qwik/src/methods/submit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { FieldValues, FormStore, ResponseData } from '../types';
33
/**
44
* Validates and submits the form.
55
*
6-
* @param form The form to be validated and submitted.
6+
* @param form The form to be submitted.
77
*/
88
export function submit<
99
TFieldValues extends FieldValues,

packages/react/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to the library will be documented in this file.
44

55
## vX.X.X (Month DD, YYYY)
66

7-
- Add `submit` method (issue #130)
7+
- Add `submit` method (issue #130, pull request #136)
88

99
## v0.5.2 (August 23, 2023)
1010

packages/react/src/methods/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export * from './setError';
1616
export * from './setResponse';
1717
export * from './setValue';
1818
export * from './setValues';
19+
export * from './submit';
1920
export * from './swap';
2021
export * from './validate';

packages/react/src/methods/submit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type { FieldValues, FormStore, ResponseData } from '../types';
33
/**
44
* Validates and submits the form.
55
*
6-
* @param form The form to be validated and submitted.
6+
* @param form The form to be submitted.
77
*/
88
export function submit<
99
TFieldValues extends FieldValues,
1010
TResponseData extends ResponseData
1111
>(form: FormStore<TFieldValues, TResponseData>): void {
12-
form.element.value?.requestSubmit();
12+
form.element.peek()?.requestSubmit();
1313
}

packages/solid/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to the library will be documented in this file.
44

55
## vX.X.X (Month DD, YYYY)
66

7-
- Add `submit` method (issue #130)
7+
- Add `submit` method (issue #130, pull request #136)
88

99
## v0.19.2 (August 23, 2023)
1010

0 commit comments

Comments
 (0)