Skip to content

Commit

Permalink
fix: dispatcher clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushAgrawal-A2 committed Dec 28, 2023
1 parent d6473a6 commit d41dc44
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions packages/block-std/src/event/control/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ export class ClipboardControl {
}

private _cut = (event: ClipboardEvent) => {
// if (
// !event.target ||
// !this._dispatcher.host.contains(event.target as Node)
// ) {
// return;
// }
const selection = this._dispatcher.std.selection.value;
if (!selection.length) return;

const clipboardEventState = new ClipboardEventState({
event,
Expand All @@ -33,12 +29,8 @@ export class ClipboardControl {
};

private _copy = (event: ClipboardEvent) => {
// if (
// !event.target ||
// !this._dispatcher.host.contains(event.target as Node)
// ) {
// return;
// }
const selection = this._dispatcher.std.selection.value;
if (!selection.length) return;

const clipboardEventState = new ClipboardEventState({
event,
Expand All @@ -50,12 +42,8 @@ export class ClipboardControl {
};

private _paste = (event: ClipboardEvent) => {
// if (
// !event.target ||
// !this._dispatcher.host.contains(event.target as Node)
// ) {
// return;
// }
if (!event.target || !this._dispatcher.host.contains(event.target as Node))
return;

const clipboardEventState = new ClipboardEventState({
event,
Expand Down

0 comments on commit d41dc44

Please sign in to comment.