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: Shared field styles break when fields are not immediate children of form #41704

Open
aaronrobertshaw opened this issue Feb 11, 2025 · 1 comment · May be fixed by #41708
Open

Forms: Shared field styles break when fields are not immediate children of form #41704

aaronrobertshaw opened this issue Feb 11, 2025 · 1 comment · May be fixed by #41708
Assignees
Labels
[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 [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Low [Status] Auto-allocated [Status] In Progress Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@aaronrobertshaw
Copy link
Contributor

Impacted plugin

Jetpack

Quick summary

Only fields that are immediate children of a form will correctly share sync'd style attributes regardless of opt-in to the feature.

Screen.Recording.2025-02-11.at.1.09.11.pm.mp4

Steps to reproduce

  1. Add a form to a post
  2. Add some additional fields and nest them within a container block e.g. Group, Row, Stack, Columns etc.
  3. Ensure all the form fields have "Sync fields style" toggled on
  4. Try styling one of the nested fields, notw that only the top-level, immediate form child fields, will update. The nested field that has opted into the shared style misses out.
  5. Switch to the field that missed out, adjust its styles and note the same result.
  6. Adjust styles on a top level form field and note no nested fields get updated.
Here's some test block markup
<!-- wp:jetpack/contact-form {"style":{"spacing":{"padding":{"top":"16px","right":"16px","bottom":"16px","left":"16px"}}}} -->
<div class="wp-block-jetpack-contact-form" style="padding-top:16px;padding-right:16px;padding-bottom:16px;padding-left:16px"><!-- wp:jetpack/field-name {"required":true} /-->

<!-- wp:jetpack/field-email {"required":true} /-->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:jetpack/field-name {"required":true,"width":50} /-->

<!-- wp:jetpack/field-email {"required":true,"width":50} /--></div>
<!-- /wp:group -->

<!-- wp:jetpack/field-textarea {"label":"Message"} /-->

<!-- wp:jetpack/button {"element":"button","text":"Contact Us","lock":{"remove":true}} /--></div>
<!-- /wp:jetpack/contact-form -->

Site owner impact

Fewer than 20% of the total website/platform users

Severity

Minor

What other impact(s) does this issue have?

No response

If a workaround is available, please outline it here.

The only work around is to manually adjust all the nested fields individually or un-nest them.

Platform (Simple and/or Atomic)

Simple, Atomic, Self-hosted

@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 [Status] In Progress [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Feb 11, 2025
@aaronrobertshaw aaronrobertshaw self-assigned this Feb 11, 2025
@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Low labels Feb 11, 2025
@aaronrobertshaw aaronrobertshaw linked a pull request Feb 11, 2025 that will close this issue
3 tasks
@Robertght
Copy link

@aaronrobertshaw I can see you're already on top of this so I'm going to mark this as Triaged on the One Board. For future similar cases, feel free to mark them like that too. Thank you!

@Robertght Robertght added Triaged and removed Needs triage Ticket needs to be triaged labels Feb 11, 2025
@Robertght Robertght moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Feb 11, 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] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Low [Status] Auto-allocated [Status] In Progress Triaged [Type] Bug When a feature is broken and / or not performing as intended
Projects
Development

Successfully merging a pull request may close this issue.

3 participants