mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Resize handler detection should not be active when moving multip… (#767)
* Fix bug. * Implement `getSelectedElements`. * Explicit condition. * Respect variable naming. * Keep state consistent. * Use `isSomeElementSelected` abstraction. * Missing ones.
This commit is contained in:
parent
ad72946131
commit
6ebd41734f
9 changed files with 53 additions and 37 deletions
|
@ -1,5 +1,5 @@
|
|||
import { Action } from "./types";
|
||||
import { deleteSelectedElements } from "../scene";
|
||||
import { deleteSelectedElements, isSomeElementSelected } from "../scene";
|
||||
import { KEYS } from "../keys";
|
||||
|
||||
export const actionDeleteSelected: Action = {
|
||||
|
@ -12,6 +12,6 @@ export const actionDeleteSelected: Action = {
|
|||
},
|
||||
contextItemLabel: "labels.delete",
|
||||
contextMenuOrder: 3,
|
||||
commitToHistory: (_, elements) => elements.some(el => el.isSelected),
|
||||
commitToHistory: (_, elements) => isSomeElementSelected(elements),
|
||||
keyTest: event => event.key === KEYS.BACKSPACE || event.key === KEYS.DELETE,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue