Make clearSelection return a new array

This commit is contained in:
Gasim Gasimzada 2020-01-09 15:34:04 +04:00
parent 332fc518b7
commit a7df901946

View file

@ -30,11 +30,13 @@ export function setSelection(
}
export function clearSelection(elements: readonly ExcalidrawElement[]) {
elements.forEach(element => {
const newElements = [...elements];
newElements.forEach(element => {
element.isSelected = false;
});
return elements;
return newElements;
}
export function deleteSelectedElements(elements: readonly ExcalidrawElement[]) {