Skip to content

[6.x] When sets are expanded, add isolation to force a new stacking context.…#14121

Merged
jaygeorge merged 1 commit into6.xfrom
bard-toolbar-isolation
Mar 2, 2026
Merged

[6.x] When sets are expanded, add isolation to force a new stacking context.…#14121
jaygeorge merged 1 commit into6.xfrom
bard-toolbar-isolation

Conversation

@jaygeorge
Copy link
Contributor

Description of the Problem

  • Up until recently, we had contain: paint wrapped around sets.
    • contain: paint was originally used to prevent overflow in a performant way (it's more performant than simply hiding elements, because it also tells the browser not to even render anything outside the boundaries)
    • A side effect of using contain: paint is that it also creates a new stacking context

Well, it turns out that contain: paint had both bad and good side effects

  • The bad side effect was that it also clipped Bard floating toolbars
  • The good side effect was that it created a new stacking context. This inadvertently meant that even when you had a Bard fixed toolbar inside a Bard fixed toolbar, the inner Bard toolbar would remain below the outer Bard toolbar, even though it had the same z-index value.

2026-03-02 at 13 48 19@2x

So… removing contain: paint for open sets to fix #14007 means that we no longer have that "new stacking context" applied, which in turn means that inner Bard toolbars appear above outer Bard toolbars

2026-03-02 at 13 52 15@2x

What this PR Does

  • This PR means we have the best of both worlds…
    • contain: paint is still conditionally applied when sets are closed, for maximum rendering performance
    • When sets are open we use isolation: isolate, which creates a new stacking context.

How to Reproduce

  1. Add a Bard fieldtype within a Bard fieldtype (fixed toolbars)
  2. Focus on the parent Bard fieldtype and scroll to see what happens when you go over the next Bard toolbar
  3. Before this fix the inner toolbar would overlap the outer toolbar
  4. But post-fix the outer toolbar stays on top until you switch focus to an inner Bard field

… This means outer Bard toolbars will have a effectively have a higher "z-index" than ones inside, so inner toolbars don't appear above outer ones
@jaygeorge jaygeorge merged commit 65aa98f into 6.x Mar 2, 2026
12 checks passed
@jaygeorge jaygeorge deleted the bard-toolbar-isolation branch March 2, 2026 14:37
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.

1 participant