diff --git a/packages/frontend/component/src/components/resize-panel/resize-panel.css.ts b/packages/frontend/component/src/components/resize-panel/resize-panel.css.ts index d8bb76a88fc9e..36668728ca051 100644 --- a/packages/frontend/component/src/components/resize-panel/resize-panel.css.ts +++ b/packages/frontend/component/src/components/resize-panel/resize-panel.css.ts @@ -34,7 +34,7 @@ export const root = style({ }, '&[data-open="true"][data-handle-position="left"][data-is-floating="true"]': { - transform: `translateX(-${panelWidthVar})`, + transform: `translateX(calc(${panelWidthVar} * -1))`, }, '&[data-enable-animation="true"]': { transition: `margin-left ${animationTimeout}, margin-right ${animationTimeout}, transform ${animationTimeout}, background ${animationTimeout}`, @@ -46,6 +46,12 @@ export const root = style({ }, }); +export const content = style({ + contain: 'strict', + width: '100%', + height: '100%', +}); + export const panelContent = style({ position: 'relative', height: '100%', diff --git a/packages/frontend/component/src/components/resize-panel/resize-panel.tsx b/packages/frontend/component/src/components/resize-panel/resize-panel.tsx index 2d9dea2ad2d63..0e298e3e0533c 100644 --- a/packages/frontend/component/src/components/resize-panel/resize-panel.tsx +++ b/packages/frontend/component/src/components/resize-panel/resize-panel.tsx @@ -169,7 +169,9 @@ export const ResizePanel = forwardRef( data-handle-position={resizeHandlePos} data-enable-animation={enableAnimation && !resizing} > - {!(status === 'exited' && unmountOnExit !== false) && children} +
+ {!(status === 'exited' && unmountOnExit !== false) && children} +
{ }); await page.mouse.up(); const boundingBox = await page.getByTestId('app-sidebar').boundingBox(); - expect(boundingBox?.width).toBe(399); + expect(Math.floor(boundingBox?.width ?? 0)).toBe(399); }); test('Sidebar in between sm & md breakpoint', async ({ page }) => { diff --git a/tests/affine-local/e2e/subpage.spec.ts b/tests/affine-local/e2e/subpage.spec.ts deleted file mode 100644 index 60bd74e999e81..0000000000000 --- a/tests/affine-local/e2e/subpage.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { test } from '@affine-test/kit/playwright'; -import { openHomePage } from '@affine-test/kit/utils/load-page'; -import { waitForEditorLoad } from '@affine-test/kit/utils/page-logic'; -import { expect } from '@playwright/test'; - -test('Create subpage', async ({ page }) => { - await openHomePage(page); - await waitForEditorLoad(page); - await page - .locator('[data-testid=app-sidebar-arrow-button-collapse][data-show=true]') - .click(); - const sliderBarArea = page.getByTestId('sliderBar-inner'); - await expect(sliderBarArea).not.toBeInViewport(); -});