fix(core): prevent unselectable elements from being selected

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-01-07 18:04:09 +01:00
committed by Braks
parent bd3720a70d
commit 7810769835
+6 -1
View File
@@ -206,7 +206,12 @@ export const createRemoveChange = (id: string): NodeRemoveChange | EdgeRemoveCha
export const getSelectionChanges = (elements: FlowElements, selectedIds: string[]) => {
return elements.reduce(
(res, item) => {
const willBeSelected = selectedIds.includes(item.id)
let willBeSelected = selectedIds.includes(item.id)
if (isDef(item.selectable) && !item.selectable) {
willBeSelected = false
}
const key = isGraphNode(item) ? 'changedNodes' : 'changedEdges'
if (!item.selected && willBeSelected) {