fix: insert images uploaded from the note menu (#32793)

This commit is contained in:
G30 authored and GitHub committed 2026-10-21 01:37:04 +09:00
1 parent 312d113fd0
commit 4604f2a3bc
1 file changed
+14 -2
+14 -2
View File
@@ -694,8 +694,20 @@ ${content}
input.onchange = async () => {
const inputFiles = Array.from(input.files ?? []);
if (inputFiles.length > 0) {
await inputFilesHandler(inputFiles);
for (const file of inputFiles) {
const fileItem = await inputFileHandler(file);
if (fileItem?.type === 'image' && editor) {
editor
.chain()
.insertContentAt(editor.state.selection.$anchor.pos, {
type: 'image',
attrs: {
src: `data://${fileItem.id}`
}
})
.focus()
.run();
}
}
};
};