Add Escape to shortcut to deselect replaceContainer
This commit is contained in:
parent
b4c9c34403
commit
2d1e5c94d7
2 changed files with 98 additions and 69 deletions
|
@ -7,7 +7,8 @@ export function OnKey(
|
|||
history: IHistoryState[],
|
||||
historyCurrentStep: number,
|
||||
setHistoryCurrentStep: Dispatch<SetStateAction<number>>,
|
||||
deleteAction: () => void
|
||||
deleteAction: () => void,
|
||||
resetState: () => void
|
||||
): void {
|
||||
if (!ENABLE_SHORTCUTS) {
|
||||
return;
|
||||
|
@ -27,5 +28,7 @@ export function OnKey(
|
|||
setHistoryCurrentStep(historyCurrentStep + 1);
|
||||
} else if (event.key === 'Delete') {
|
||||
deleteAction();
|
||||
} else if (event.key === 'Escape') {
|
||||
resetState();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue