Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): should not close peek view when clicking at menu items (#11344)

pengx17d96f00925c6a
diff --git a/blocksuite/affine/blocks/block-root/src/widgets/linked-doc/linked-doc-popover.ts b/blocksuite/affine/blocks/block-root/src/widgets/linked-doc/linked-doc-popover.ts
index 27a62b5579..5ef3388293 100644
--- a/blocksuite/affine/blocks/block-root/src/widgets/linked-doc/linked-doc-popover.ts
+++ b/blocksuite/affine/blocks/block-root/src/widgets/linked-doc/linked-doc-popover.ts
@@ -304,6 +304,11 @@ export class LinkedDocPopover extends SignalWatcher(
data-id=${key}
.text=${name}
hover=${this._activatedItemKey === key}
+ @pointerdown=${(e: PointerEvent) => {
+ // Prevent event listeners being registered on the root document
+ // eg., radix-ui dialogs usePointerDownOutside hooks
+ e.stopPropagation();
+ }}
@click=${() => {
action()?.catch(console.error);
}}