Skip to content

Commit

Permalink
fix: do not enable shift-click center peek in edgeless
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Sep 25, 2024
1 parent ce9a242 commit 894e8d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/affine/components/src/peek/peekable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { Constructor } from '@blocksuite/global/utils';
import type { LitElement, TemplateResult } from 'lit';

import { isInsideEdgelessEditor } from '@blocksuite/affine-shared/utils';

import type { PeekableClass, PeekableOptions } from './type.js';

import { PeekableController } from './controller.js';
Expand Down Expand Up @@ -64,7 +66,11 @@ export const Peekable =
}
});
}
if (actions.includes('shift-click')) {
if (
actions.includes('shift-click') &&
// shift click in edgeless should be selection
!isInsideEdgelessEditor(this.std.host)
) {
this.disposables.addFromEvent(target, 'click', e => {
if (e.shiftKey && this[symbol].peekable) {
e.stopPropagation();
Expand Down

0 comments on commit 894e8d4

Please sign in to comment.