Fix alignment and wrapping issues in the new form styles.

Review Request #10867 — Created Jan. 29, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

The new CSS form components had an issue where the field input area
(field widget and help text) would wrap below the label if the input
area's contents wrap. There's no easy solution if we stick with
blocks/inline-blocks for these elements, but fortunately, table-based
layout gives us exactly what we want.

This change updates .rb-c-form-field__input and
.rb-c-form-field__label to use display: table-cell when in aligned
and desktop mode. This will let us keep the input area aligned next to
the label area, with the wrapping occurring entirely within the input
area in a natural way.

Tested on some forms with a variety of inputs with and without wrapped
content in desktop and in mobile modes, making sure that the alignment
stayed and the content wrapped correctly.

Tested this in Chrome, Firefox, and Edge.

Summary ID
Fix alignment and wrapping issues in the new form styles.
The new CSS form components had an issue where the field input area (field widget and help text) would wrap below the label if the input area's contents wrap. There's no easy solution if we stick with blocks/inline-blocks for these elements, but fortunately, table-based layout gives us exactly what we want. This change updates `.rb-c-form-field__input` and `.rb-c-form-field__label` to use `display: table-cell` when in aligned and desktop mode. This will let us keep the input area aligned next to the label area, with the wrapping occurring entirely within the input area in a natural way.
8514ad853c20e80afce520f6409a115168aec73d
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (f2148da)