feat: allow multiple fields to be validated in one intent
As suggested by @edmundhung in https://github.com/edmundhung/conform/issues/830#issuecomment-2676301855
🦋 Changeset detected
Latest commit: dab55c2c9ae8176c26dceb9c496490253c3e1b35
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 4 packages
| Name | Type |
|---|---|
| @conform-to/dom | Minor |
| @conform-to/react | Minor |
| @conform-to/yup | Minor |
| @conform-to/zod | 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
More templates
@conform-to/dom
npm i https://pkg.pr.new/@conform-to/dom@878
@conform-to/react
npm i https://pkg.pr.new/@conform-to/react@878
@conform-to/yup
npm i https://pkg.pr.new/@conform-to/yup@878
@conform-to/validitystate
npm i https://pkg.pr.new/@conform-to/validitystate@878
@conform-to/zod
npm i https://pkg.pr.new/@conform-to/zod@878
commit: dab55c2
I've added a test for this case in form-control as you suggested.
Is anything else required to get this merged?
@edmundhung, let me know if anything from my side is required to drive this forward :)
@edmundhung, is this in any way obsolete or no longer useless? Or is there another reason this cannot get merged?
Hey @oxc, really sorry for the radio silence 🙏🏼
I was tied up with v2 development and wasn't sure which approach made the most sense at the time, but I have now settled on a solution in v2 that handles nested fieldset out of the box.
For example, calling validate('address') will mark every field within address as touched without any extra changes. You can also dispatch multiple intents without triggering additional re-renders. As such, there's no need to support multiple fields in the validate intent going forward, so I am gonna close this PR for now.
Thanks again for putting this up and let me know if you have any questions.