Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support submit errors and error message upon submitting a form #89

Merged
merged 6 commits into from
Dec 29, 2024

Conversation

s8n11c
Copy link
Contributor

@s8n11c s8n11c commented Dec 29, 2024

No description provided.

@s8n11c s8n11c requested a review from logaretm December 29, 2024 11:35
@s8n11c s8n11c self-assigned this Dec 29, 2024
Copy link
Member

@logaretm logaretm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, but let's change the approach.

Ideally those should live in the form and not the individual fields since submit errors won't exist unless the field is part of a form. It also would allow querying those errors on the form-level which might be desired.

So I imagine building the submit errors as a similar state to the errors we already have on the form and fields just expose them via a computed property. There is still the weird case of the search field but let's tackle that later.

Let's add tests and a changeset and this would be good to go!

Copy link

changeset-bot bot commented Dec 29, 2024

🦋 Changeset detected

Latest commit: 205c43e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@formwerk/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@s8n11c s8n11c force-pushed the feat/submit-errors branch from 2287c5e to 00000a4 Compare December 29, 2024 17:29
@s8n11c s8n11c requested a review from logaretm December 29, 2024 18:05
Copy link
Member

@logaretm logaretm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor changes to comments for the doc generation.

packages/core/src/useFormField/useFormField.ts Outdated Show resolved Hide resolved
packages/core/src/useFormField/useFormField.ts Outdated Show resolved Hide resolved
Copy link

pkg-pr-new bot commented Dec 29, 2024

Open in Stackblitz

npm i https://pkg.pr.new/formwerkjs/formwerk/@formwerk/core@89

commit: 205c43e

@logaretm logaretm merged commit b3950ce into main Dec 29, 2024
5 checks passed
@logaretm logaretm deleted the feat/submit-errors branch December 29, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants