Reset selectedElementIds when deleting selected elements (#875)

This commit is contained in:
Pete Hunt 2020-03-08 14:10:42 -07:00 committed by GitHub
parent ccbbdb75a6
commit c89584832d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View file

@ -34,7 +34,13 @@ export function deleteSelectedElements(
elements: readonly ExcalidrawElement[],
appState: AppState,
) {
return elements.filter(el => !appState.selectedElementIds[el.id]);
return {
elements: elements.filter(el => !appState.selectedElementIds[el.id]),
appState: {
...appState,
selectedElementIds: {},
},
};
}
export function getSelectedIndices(