Skip to content

Forms: stack form fields and submit button by default #41265

@monsieur-z

Description

Impacted plugin

Jetpack

What

Ensure a form submit button doesn't float when its preceding field is not 100% wide

How

Summary

In a form, setting the width of the field that precedes the submit button to less than 100% causes the button to be inlined with that field.

Width = 100% Width = 25%
Image Image

Note: moreover, the field and button are not vertically aligned

While this behavior could make sense for forms with a single field, such as login or search forms, it's unusual for most other forms. A workaround is to group the fields, as shown in the capture below, however, it adds unnecessary friction.
Image

I'd recommend stacking the fields and the submit button by default:
Image

Steps to Reproduce

  1. Spin up a Jetpack site
  2. Create a new post or page
  3. Add a form
  4. Set the width of the field preceding the submit button to something other than 100%

Metadata

Assignees

No one assigned

    Labels

    [Block] Contact FormForm block (also see Contact Form label)[Feature] Contact Form[Feature] Forms BlocksBlocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc.[Package] Forms[Plugin] JetpackIssues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/[Type] EnhancementChanges to an existing feature — removing, adding, or changing parts of it

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions