Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions web/libs/editor/src/hooks/useRegionsCopyPaste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading