From 5300eff8f1285e5880418b231bfcebc6c3ffd821 Mon Sep 17 00:00:00 2001 From: L-Sun Date: Thu, 17 Jul 2025 10:47:45 +0800 Subject: [PATCH] fix(editor): at-menu boundary in chat pannel (#13241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close [BS-3621](https://linear.app/affine-design/issue/BS-3621/comment-menu-需要规避边缘) #### PR Dependency Tree * **PR #13241** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) ## Summary by CodeRabbit * **Bug Fixes** * Improved the positioning of the linked document popover to ensure it displays correctly, even when its width is not initially rendered. #### PR Dependency Tree * **PR #13241** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) --- .../widgets/linked-doc/src/linked-doc-popover.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/blocksuite/affine/widgets/linked-doc/src/linked-doc-popover.ts b/blocksuite/affine/widgets/linked-doc/src/linked-doc-popover.ts index dc909f7cc9..f230a95af2 100644 --- a/blocksuite/affine/widgets/linked-doc/src/linked-doc-popover.ts +++ b/blocksuite/affine/widgets/linked-doc/src/linked-doc-popover.ts @@ -343,7 +343,18 @@ export class LinkedDocPopover extends SignalWatcher( override willUpdate() { if (!this.hasUpdated) { const updatePosition = throttle(() => { - this._position = getPopperPosition(this, this.context.startNativeRange); + this._position = getPopperPosition( + { + getBoundingClientRect: () => { + return { + ...this.getBoundingClientRect(), + // Workaround: the width of the popover is zero when it is not rendered + width: 280, + }; + }, + }, + this.context.startNativeRange + ); }, 10); this.disposables.addFromEvent(window, 'resize', updatePosition);