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

This commit is contained in:
G30 2026-10-20 12:37:04 -04:00 • committed by GitHub
parent 312d113fd0
commit 4604f2a3bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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();
}
}
};
};