Forms: stack form fields and submit button by default #41265
Open
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% |
---|---|
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.
I'd recommend stacking the fields and the submit button by default:
Steps to Reproduce
- Spin up a Jetpack site
- Create a new post or page
- Add a form
- Set the width of the field preceding the submit button to something other than 100%