mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-13 12:29:58 +02:00
select single element on cmd-click (#2087)
This commit is contained in:
@@ -86,6 +86,20 @@ export function selectGroupsForSelectedElements(
|
||||
return nextAppState;
|
||||
}
|
||||
|
||||
export const editGroupForSelectedElement = (
|
||||
appState: AppState,
|
||||
element: NonDeleted<ExcalidrawElement>,
|
||||
): AppState => {
|
||||
return {
|
||||
...appState,
|
||||
editingGroupId: element.groupIds.length ? element.groupIds[0] : null,
|
||||
selectedGroupIds: {},
|
||||
selectedElementIds: {
|
||||
[element.id]: true,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export function isElementInGroup(element: ExcalidrawElement, groupId: string) {
|
||||
return element.groupIds.includes(groupId);
|
||||
}
|
||||
|
Reference in New Issue
Block a user