diff --git a/web/libs/editor/src/hooks/useRegionsCopyPaste.ts b/web/libs/editor/src/hooks/useRegionsCopyPaste.ts index e3cd733db94b..315f25433850 100644 --- a/web/libs/editor/src/hooks/useRegionsCopyPaste.ts +++ b/web/libs/editor/src/hooks/useRegionsCopyPaste.ts @@ -40,6 +40,15 @@ export const useRegionsCopyPaste = (entity: any) => { return { ...res, readonly: false }; }); + // if user selected another image, we should paste in the current + // image, not the one they copied from + for (const result of results) { + const target = entity.names.get(result.to_name); + if (target.isMultiItem) { + result.item_index = target.currentItemIndex; + } + } + entity.appendResults(results); ev.preventDefault(); } catch (e) {