|
@@ -12,6 +12,7 @@ import { MIME_TYPES } from "../constants";
|
|
|
import Spinner from "./Spinner";
|
|
|
import LibraryMenuBrowseButton from "./LibraryMenuBrowseButton";
|
|
|
import clsx from "clsx";
|
|
|
+import { duplicateElements } from "../element/newElement";
|
|
|
|
|
|
const CELLS_PER_ROW = 4;
|
|
|
|
|
@@ -96,7 +97,14 @@ const LibraryMenuItems = ({
|
|
|
} else {
|
|
|
targetElements = libraryItems.filter((item) => item.id === id);
|
|
|
}
|
|
|
- return targetElements;
|
|
|
+ return targetElements.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ // duplicate each library item before inserting on canvas to confine
|
|
|
+ // ids and bindings to each library item. See #6465
|
|
|
+ elements: duplicateElements(item.elements),
|
|
|
+ };
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const createLibraryItemCompo = (params: {
|