From 006bdd29b8ee780b3f569b9cf121c0bbbe27cc0f Mon Sep 17 00:00:00 2001 From: fundon Date: Tue, 11 Mar 2025 12:39:59 +0000 Subject: [PATCH] fix(editor): clip content within menu (#10764) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: [BS-2796](https://linear.app/affine-design/issue/BS-2796/menu-中内容被剪切的问题) --- .../components/src/toolbar/menu-button.ts | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/blocksuite/affine/components/src/toolbar/menu-button.ts b/blocksuite/affine/components/src/toolbar/menu-button.ts index 363f540d1e..4c58c2866a 100644 --- a/blocksuite/affine/components/src/toolbar/menu-button.ts +++ b/blocksuite/affine/components/src/toolbar/menu-button.ts @@ -98,28 +98,10 @@ export class EditorMenuButton extends WithDisposable(LitElement) { export class EditorMenuContent extends LitElement { static override styles = css` :host { - --packed-height: 6px; - --offset-height: calc(-1 * var(--packed-height)); display: none; outline: none; overscroll-behavior: contain; - } - - :host::before, - :host::after { - content: ''; - display: block; - position: absolute; - height: var(--packed-height); - width: 100%; - } - - :host::before { - top: var(--offset-height); - } - - :host::after { - bottom: var(--offset-height); + overflow-y: auto; } :host([data-show]) { @@ -152,8 +134,7 @@ export class EditorMenuContent extends LitElement { flex-direction: column; align-items: stretch; gap: unset; - min-height: unset; - overflow-y: auto; + min-height: fit-content; } `;