diff --git a/packages/block-std/src/event/control/range.ts b/packages/block-std/src/event/control/range.ts index cf32b86df159e..2ef207bb4a22d 100644 --- a/packages/block-std/src/event/control/range.ts +++ b/packages/block-std/src/event/control/range.ts @@ -95,8 +95,8 @@ export class RangeControl { if (!endElement) return; if (startElement.closest('.blocksuite-portal')) return; - if (startElement.closest('affine-menu')) return; - if (startElement.closest('affine-multi-tag-select')) return; + if (startElement.closest('.blocksuite-modal')) return; + if (startElement.closest('.default-toolbar')) return; const pageBlock = this._dispatcher.std.view.viewFromPath('block', [ this._dispatcher.std.page.root?.id ?? '', @@ -106,10 +106,12 @@ export class RangeControl { const viewport = pageBlock.viewportElement; assertExists(viewport); if (!viewport.contains(startElement)) { + // console.log(startElement); this._dispatcher.focus = false; return; } if (!viewport.contains(endElement)) { + // console.log(endElement); this._dispatcher.focus = false; return; } diff --git a/packages/blocks/src/_common/components/menu/menu.ts b/packages/blocks/src/_common/components/menu/menu.ts index 09f574bb3e925..fef0fe4a8b969 100644 --- a/packages/blocks/src/_common/components/menu/menu.ts +++ b/packages/blocks/src/_common/components/menu/menu.ts @@ -669,6 +669,7 @@ declare global { } export const createModal = (container: HTMLElement = document.body) => { const div = document.createElement('div'); + div.classList.add('blocksuite-modal'); div.style.position = 'fixed'; div.style.left = '0'; div.style.top = '0';