Skip to content

Commit

Permalink
fix: try
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushAgrawal-A2 committed Dec 28, 2023
1 parent 6f20bd4 commit d987a5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/block-std/src/event/control/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? '',
Expand All @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions packages/blocks/src/_common/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit d987a5d

Please sign in to comment.