Skip to content

Remote functions form enhance documentation is confusingΒ #15099

@ahjulstad

Description

@ahjulstad

Describe the bug

The current example

 <form {...createPost.enhance(async ({ form, data, submit }) => {
	try {
		await submit();
		form.reset();

		showToast('Successfully published!');
	} catch (error) {
		showToast('Oh no! Something went wrong');
	}
})}>
	<!-- -->
</form>

gives the impression, given the preceding examples with validation, that a successful submit() implicitly means that the validation was successful.

The documentation would be better if it showed explicit handling of failed validation.

Reproduction

N/A

Logs

N/A

System Info

N/A

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions