mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: paste not working anywhere in the editor
(fixes streetwriters/notesnook#740)
This commit is contained in:
@@ -132,14 +132,12 @@ export default function EditorManager({
|
|||||||
onPaste={async (event) => {
|
onPaste={async (event) => {
|
||||||
if (!editor) return;
|
if (!editor) return;
|
||||||
|
|
||||||
if (event.clipboardData?.items?.length) {
|
if (event.clipboardData?.files?.length) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
for (let file of event.clipboardData.files) {
|
||||||
for (let item of event.clipboardData.items) {
|
|
||||||
const file = item.getAsFile();
|
|
||||||
if (!file) continue;
|
|
||||||
const result = await attachFile(file);
|
const result = await attachFile(file);
|
||||||
if (!result) continue;
|
if (!result) continue;
|
||||||
|
|
||||||
editor.attachFile(result);
|
editor.attachFile(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user