Skip to content

[6.x] Forms 2: Centre the empty section's hint and fit it to the screen - #16170

Merged
jaygeorge merged 2 commits into
6.xfrom
16170-form-builder-empty-section
Dec 3, 2026
Merged

jaygeorge merged 2 commits into
6.xfrom
16170-form-builder-empty-section

Conversation

@jaygeorge

@jaygeorge jaygeorge commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Description of the Problem

Closes #16113

When a form's only section is empty, the drop zone is a fixed 670px tall, so on a laptop the "Drag fields here…" hint sits low and the box runs off the bottom of the screen. The hint also isn't centred, so once it wraps (narrow window, longer translations) its lines sit on the left.

image

What this PR Does

  • Centres the hint, so wrapped lines and the Link Existing button stay in the middle.
  • Sizes the only empty section to the screen: min(670px, 100dvh - 22rem), never under 200px. Tall screens still get 670px; laptops get a box that fits.
  • Adds some horizontal padding so the hint doesn't run into the dashed border.

I went with a height based on the viewport rather than the issue's other idea (200px, like later sections), because the first section is the main drop target on a new form and a 200px box looks lost on a big empty canvas.

Before / After

file-495dde992fbb1afaefd9d0b563bbe0d5

How to Reproduce

  1. Create a new form, so its only section is empty.
  2. Open the builder on a laptop-height window and narrow it until the hint wraps.
  3. On 6.x the box runs below the fold and the hint is left-aligned; on this branch it fits and the hint is centred.

- Centre the hint so wrapped lines don't leave "or" alone on the left
- Size the only empty section to the viewport (200px to 670px) so the hint stays above the fold
- Pad it horizontally so the hint doesn't touch the dashed border
@jaygeorge
jaygeorge merged commit 6c481e6 into 6.x Dec 3, 2026
65 checks passed
@jaygeorge
jaygeorge deleted the 16170-form-builder-empty-section branch December 3, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Form builder: empty section is very tall and its hint is left-aligned when it wraps

1 participant