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

fix(Form)!: include nested state in submit data #3028

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

romhml
Copy link
Collaborator

@romhml romhml commented Jan 6, 2025

πŸ”— Linked issue

#2889

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Fixes an issue with nested form state not being included in the @submit event payload.
The proposed solution requires to apply schema transformation to the state (partially reverting #2701) to return the props.state object in the submit event data.

Another alternative would be to return a list of objects in the submit payload (with transformation applied) instead of the full object. We can't easily reconstruct the full object since we don't have the information of a nested form's state path within the parent form's state.

I added a new transform options in the form's validate function to control when transformations are applied. It's currently done on submit only.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@romhml romhml force-pushed the fix/nested-form-event-data branch 2 times, most recently from 07ac559 to 517acae Compare January 6, 2025 12:58
Copy link

cloudflare-workers-and-pages bot commented Jan 6, 2025

Deploying ui3 with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: 93aea7e
Status:Β βœ…Β  Deploy successful!
Preview URL: https://e9f05a6c.ui-6q2.pages.dev
Branch Preview URL: https://fix-nested-form-event-data.ui-6q2.pages.dev

View logs

Copy link

pkg-pr-new bot commented Jan 6, 2025

npm i https://pkg.pr.new/@nuxt/ui@3028

commit: 93aea7e

@romhml romhml marked this pull request as ready for review January 11, 2025 17:38
@benjamincanac benjamincanac added the v3 #1289 label Jan 13, 2025
@romhml romhml force-pushed the fix/nested-form-event-data branch from fddd2e5 to 93aea7e Compare January 14, 2025 09:23
@benjamincanac benjamincanac merged commit de9ecb1 into v3 Jan 14, 2025
3 checks passed
@benjamincanac benjamincanac deleted the fix/nested-form-event-data branch January 14, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 #1289
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants