From 180bf87a77fa8841f4492efa335cb3c85b39b466 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 2 Mar 2024 23:44:09 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/10479 --- app/src/protyle/hint/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index c8651b343..1f4cf9fa6 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -210,9 +210,8 @@ ${unicode2Emoji(emoji.unicode)}`; } public bindUploadEvent(protyle: IProtyle, element: HTMLElement) { - const uploadElement = element.querySelector('input[type="file"]'); - if (uploadElement) { - uploadElement.addEventListener("change", (event: InputEvent & { target: HTMLInputElement }) => { + element.querySelectorAll('input[type="file"]').forEach(item => { + item.addEventListener("change", (event: InputEvent & { target: HTMLInputElement }) => { if (event.target.files.length === 0) { return; } @@ -224,7 +223,7 @@ ${unicode2Emoji(emoji.unicode)}`; uploadFiles(protyle, event.target.files, event.target); hideElements(["hint", "toolbar"], protyle); }); - } + }); } private getHTMLByData(data: IHintData[]) {