conform icon indicating copy to clipboard operation
conform copied to clipboard

feat: allow multiple fields to be validated in one intent

Open oxc opened this issue 11 months ago • 5 comments

As suggested by @edmundhung in https://github.com/edmundhung/conform/issues/830#issuecomment-2676301855

oxc avatar Mar 12 '25 04:03 oxc

🦋 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

changeset-bot[bot] avatar Mar 12 '25 04:03 changeset-bot[bot]

Open in Stackblitz

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

pkg-pr-new[bot] avatar Mar 12 '25 04:03 pkg-pr-new[bot]

I've added a test for this case in form-control as you suggested.

oxc avatar Mar 21 '25 15:03 oxc

Is anything else required to get this merged?

oxc avatar Apr 13 '25 18:04 oxc

@edmundhung, let me know if anything from my side is required to drive this forward :)

oxc avatar Jun 05 '25 09:06 oxc

@edmundhung, is this in any way obsolete or no longer useless? Or is there another reason this cannot get merged?

oxc avatar Jul 19 '25 14:07 oxc

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.

edmundhung avatar Aug 07 '25 22:08 edmundhung