diff --git a/frontend/src/components/input/editor/TipTap.vue b/frontend/src/components/input/editor/TipTap.vue index d562646a2..ff7d0ca71 100644 --- a/frontend/src/components/input/editor/TipTap.vue +++ b/frontend/src/components/input/editor/TipTap.vue @@ -355,11 +355,12 @@ const PasteHandler = Extension.create({ key: new PluginKey('pasteHandler'), props: { handlePaste: (view, event) => { - - // Handle images pasted from clipboard - if (typeof props.uploadCallback !== 'undefined' && event.clipboardData?.items?.length > 0) { - for (const item of event.clipboardData.items) { + // Handle images pasted from clipboard + if (typeof props.uploadCallback !== 'undefined' && event.clipboardData?.items && event.clipboardData.items.length > 0) { + + for (let i = 0; i < event.clipboardData.items.length; i++) { + const item = event.clipboardData.items[i] if (item.kind === 'file' && item.type.startsWith('image/')) { const file = item.getAsFile() if (file) {