From fd244f909d1abf781fbc33fc91851ce864cba657 Mon Sep 17 00:00:00 2001 From: yoyoyohamapi <8338436+yoyoyohamapi@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:58:39 +0000 Subject: [PATCH] fix(core): positioning error in fixed floating submenu (#10606) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue:Close [BS-2150](https://linear.app/affine-design/issue/BS-2150/图片-filterprocessing-二级菜单时而不出现) In the AI image menu (based on floating-ui): - **Floating element**: Submenu items (e.g., "image filter/image processing") - **Reference element**: Menu item - **Positioning strategy**: `fixed` - **Issue**: Specifying the `container` parameter caused the floating element (submenu) to be mounted to the reference element (menu item), leading to incorrect position calculations when floating-ui updated. ```jsx ``` - **Fix**: Remove the `container` configuration and mount the `fixed`-positioned floating element to the `body` instead. --- .../core/src/blocksuite/ai/components/ai-item/ai-item-list.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/frontend/core/src/blocksuite/ai/components/ai-item/ai-item-list.ts b/packages/frontend/core/src/blocksuite/ai/components/ai-item/ai-item-list.ts index a95db5cb72..bfc7807a66 100644 --- a/packages/frontend/core/src/blocksuite/ai/components/ai-item/ai-item-list.ts +++ b/packages/frontend/core/src/blocksuite/ai/components/ai-item/ai-item-list.ts @@ -92,7 +92,6 @@ export class AIItemList extends WithDisposable(LitElement) { .onClick=${this.onClick} .abortController=${this._abortController} >`, - container: aiItemContainer, positionStrategy: 'fixed', computePosition: { referenceElement: aiItemContainer,