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

Forms: Migrate form fields to inner blocks #42358

Open
4 tasks
aaronrobertshaw opened this issue Mar 11, 2025 · 0 comments
Open
4 tasks

Forms: Migrate form fields to inner blocks #42358

aaronrobertshaw opened this issue Mar 11, 2025 · 0 comments
Assignees
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms Triaged [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@aaronrobertshaw
Copy link
Contributor

Part of: #42353
Related: #41281
Project Thread: TBA

Description

This issue finalizes the switch to form field inner blocks by introducing block deprecations that transform each form field into the new structure. We’ll also update the style syncing logic and shortcode rendering to handle child blocks correctly.

Scope & Requirements

  • Implement block deprecations mapping old attributes (label text, input type, etc.) into new Label, Input, and Option blocks.
  • Update shortcode rendering functions to collect styling data from nested blocks and apply it to generated HTML.
  • Ensure style syncing (if enabled) is compatible with multiple child blocks within a single field.

Tasks

  • Add block deprecations
    • For each current field type, define a deprecation transforming it into a parent container with inner blocks.
    • Test with posts that contain older forms to confirm a smooth upgrade experience.
  • Update shortcode rendering
    • Map nested child block attributes to the expected markup or classes.
    • Confirm frontend display remains consistent for non-migrated and migrated blocks alike
  • Refactor style syncing
    • Refactor existing HoC to a new custom hook that handles style syncing in a manner compatible with child blocks.
  • Final tests & validation
    • Add or update automated tests to confirm no regressions.
    • Check multiple field scenarios (text, email, radio, checkbox) in both old and new states.
@aaronrobertshaw aaronrobertshaw added [Block] Contact Form Form block (also see Contact Form label) [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Triaged labels Mar 11, 2025
@aaronrobertshaw aaronrobertshaw self-assigned this Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms Triaged [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

2 participants