Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/vls-65' into vls-65
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikMix committed May 30, 2024
2 parents f1cc1f9 + 41f19c2 commit c07bd9c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions public/src/components/Editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ export class Editor {
this.tippyCallbacks = tippy;
this.addPlugins();

document.onpaste = (event) => {
event.preventDefault();

let paste = (event.clipboardData).getData("text");
const selection = window.getSelection();
if (!selection.rangeCount) return;
selection.deleteFromDocument();
selection.getRangeAt(0).insertNode(document.createTextNode(paste));
selection.collapseToEnd();
}

this.editable = document.createElement('div');
this.editable.id = "note-editor-inner"
this.editable.contentEditable = "true";
Expand Down

0 comments on commit c07bd9c

Please sign in to comment.