mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Enable deselection in graph for readers
This commit is contained in:
parent
dc1024dce1
commit
e86e7b7ace
|
@ -177,17 +177,22 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
|
||||
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
|
||||
// Hotkeys implementation
|
||||
if (!controller.isContentEditable || controller.isProcessing) {
|
||||
if (controller.isProcessing) {
|
||||
return;
|
||||
}
|
||||
if (event.key === 'Delete') {
|
||||
event.preventDefault();
|
||||
handleDeleteCst();
|
||||
}
|
||||
if (event.key === 'Escape') {
|
||||
event.preventDefault();
|
||||
setFocusCst(undefined);
|
||||
controller.deselectAll();
|
||||
return;
|
||||
}
|
||||
if (!controller.isContentEditable) {
|
||||
return;
|
||||
}
|
||||
if (event.key === 'Delete') {
|
||||
event.preventDefault();
|
||||
handleDeleteCst();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user