diff --git a/packages/studio/src/components/editor/propertyPanelFlatPrimitives.test.tsx b/packages/studio/src/components/editor/propertyPanelFlatPrimitives.test.tsx index dccf1aa232..de03e73af4 100644 --- a/packages/studio/src/components/editor/propertyPanelFlatPrimitives.test.tsx +++ b/packages/studio/src/components/editor/propertyPanelFlatPrimitives.test.tsx @@ -125,6 +125,11 @@ describe("FlatGroup", () => { , ); expect(host.querySelector('[data-testid="body"]')).not.toBeNull(); + const header = host.querySelector('[data-flat-group-open="true"] > div'); + expect(header?.className).toContain("sticky"); + expect(header?.className).toContain("top-0"); + expect(header?.className).toContain("bottom-0"); + expect(header?.className).toContain("bg-panel-bg"); const pin = host.querySelector('[data-flat-group-pin="true"]'); act(() => pin?.dispatchEvent(new MouseEvent("click", { bubbles: true }))); expect(onTogglePin).toHaveBeenCalledTimes(1); @@ -148,6 +153,10 @@ describe("FlatGroup", () => { expect(host.querySelector('[data-testid="body"]')).toBeNull(); expect(host.textContent).toContain("fill none ยท 100%"); const row = host.querySelector('[data-flat-group-collapsed="true"]'); + expect(row?.className).toContain("sticky"); + expect(row?.className).toContain("top-0"); + expect(row?.className).toContain("bottom-0"); + expect(row?.className).toContain("bg-panel-bg"); act(() => row?.dispatchEvent(new MouseEvent("click", { bubbles: true }))); expect(onToggleOpen).toHaveBeenCalledTimes(1); act(() => root.unmount()); @@ -469,6 +478,11 @@ describe("PinnedGroupRow", () => { expect(host.textContent).toContain("Pinned"); expect(host.textContent).toContain("Motion"); expect(host.querySelector('[data-testid="body"]')).not.toBeNull(); + const header = host.querySelector('[data-pinned-group="true"] > div'); + expect(header?.className).toContain("sticky"); + expect(header?.className).toContain("top-0"); + expect(header?.className).toContain("bottom-0"); + expect(header?.className).toContain("bg-panel-bg"); const unpin = host.querySelector('[data-pinned-group-unpin="true"]'); act(() => unpin?.dispatchEvent(new MouseEvent("click", { bubbles: true }))); expect(onUnpin).toHaveBeenCalledTimes(1); diff --git a/packages/studio/src/components/editor/propertyPanelFlatPrimitives.tsx b/packages/studio/src/components/editor/propertyPanelFlatPrimitives.tsx index 21f02295f5..5adc978cfa 100644 --- a/packages/studio/src/components/editor/propertyPanelFlatPrimitives.tsx +++ b/packages/studio/src/components/editor/propertyPanelFlatPrimitives.tsx @@ -161,7 +161,7 @@ export function FlatGroup({ type="button" data-flat-group-collapsed="true" onClick={onToggleOpen} - className="flex min-h-10 w-full items-center justify-between gap-2 border-b border-panel-hairline px-4 text-left" + className="sticky top-0 bottom-0 z-10 flex min-h-10 w-full items-center justify-between gap-2 border-b border-panel-hairline bg-panel-bg px-4 text-left" > {title} @@ -186,7 +186,7 @@ export function FlatGroup({ return (
-
+
{title} {accessory} @@ -467,7 +467,7 @@ export function PinnedGroupRow({ }) { return (
-
+
Pinned