Skip to content

Commit

Permalink
Use "editor-paste" event instead of raw paste
Browse files Browse the repository at this point in the history
This prevents us from capturing pastes in search fields
  • Loading branch information
zolrath committed Jan 20, 2022
1 parent db5a7d5 commit c41f276
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ export default class AutoLinkTitle extends Plugin {
hotkeys: [],
});

this.app.workspace.containerEl.addEventListener(
"paste",
this.pasteFunction,
true
this.registerEvent(
this.app.workspace.on("editor-paste", this.pasteFunction)
);

this.addCommand({
Expand Down

0 comments on commit c41f276

Please sign in to comment.