Skip to content

Commit

Permalink
fix: fix clipboard.setData fial in workspace mode
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping authored and JackLian committed Jan 12, 2024
1 parent 8931d83 commit 34a5a11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/designer/src/designer/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class Clipboard implements IClipboard {

private waitFn?: (data: any, e: ClipboardEvent) => void;

constructor() {
this.injectCopyPaster(document);
}

isCopyPasteEvent(e: Event) {
this.isCopyPaster(e.target);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/designer/src/designer/designer-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import BuiltinDragGhostComponent from './drag-ghost';
import { Designer, DesignerProps } from './designer';
import { ProjectView } from '../project';
import './designer.less';
import { clipboard } from './clipboard';

type IProps = DesignerProps & {
designer?: Designer;
Expand Down Expand Up @@ -44,7 +43,6 @@ export class DesignerView extends Component<IProps> {
if (onMount) {
onMount(this.designer);
}
clipboard.injectCopyPaster(document);
this.designer.postEvent('mount', this.designer);
}

Expand Down

0 comments on commit 34a5a11

Please sign in to comment.