mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +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>) {
|
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
|
||||||
// Hotkeys implementation
|
// Hotkeys implementation
|
||||||
if (!controller.isContentEditable || controller.isProcessing) {
|
if (controller.isProcessing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.key === 'Delete') {
|
|
||||||
event.preventDefault();
|
|
||||||
handleDeleteCst();
|
|
||||||
}
|
|
||||||
if (event.key === 'Escape') {
|
if (event.key === 'Escape') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setFocusCst(undefined);
|
setFocusCst(undefined);
|
||||||
controller.deselectAll();
|
controller.deselectAll();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!controller.isContentEditable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.key === 'Delete') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleDeleteCst();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user