Skip to content

[6.x] Forms 2: Collapse the header tabs when they don't fit - #16173

Merged
jaygeorge merged 2 commits into
6.xfrom
16173-form-header-tabs-collapse-when-tight
Dec 3, 2026
Merged

jaygeorge merged 2 commits into
6.xfrom
16173-form-header-tabs-collapse-when-tight

Conversation

@jaygeorge

@jaygeorge jaygeorge commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Description of the Problem

Closes #16115

The form tabs (Edit, Logic, Connect, Results, Configure) sit in the header from 1024px up. In German they need about 1120px, so in between the header scrolls sideways and the icons on the right end up off screen.

The header is designed to overflow when it runs out of space, so I wouldn’t call it a bug, per se 🙂. That said, I can see that something like a dropdown might be considered tidier in a longer language like German, and where there are other things going on like multisite. It's lightweight to implement, so I’m happy to switch to that.

dyn-16087446c1510e62d37689249e2c9d6b

What this PR Does

  • Swaps the tabs for the existing dropdown whenever they'd make the header overflow, whatever the language
  • A ResizeObserver on the header shows the tabs, checks for overflow, and collapses them if needed, all before paint, so there's no flicker
  • If a tab or the dropdown had focus when they swap, focus moves to whichever replaced it

Before / After

image

How to Reproduce

  1. Set the CP language to German
  2. Open any form's builder
  3. Make the window about 1030px wide
  4. The header's right-hand icons are cut off. With this PR the tabs fold into a dropdown instead

- Longer translations (German needs ~1120px) pushed the header's right-hand icons off screen between 1024px and the width the tabs need
- The tabs now swap for the dropdown whenever they'd make the header overflow, and focus moves to the dropdown if a tab had it
- Widening the window hid a focused dropdown button and dropped focus to the page; focus now goes to whichever of the tabs or dropdown replaced it
@jaygeorge
jaygeorge merged commit 34ab3d0 into 6.x Dec 3, 2026
66 checks passed
@jaygeorge
jaygeorge deleted the 16173-form-header-tabs-collapse-when-tight branch December 3, 2026 23:32
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: layout shifts at the mobile breakpoint

1 participant