Toggle focus between tree and text.

This commit is contained in:
Magnus Åhall 2025-02-09 20:22:26 +01:00
parent 8f15664b88
commit 4ce8ed9a08
3 changed files with 13 additions and 8 deletions

View file

@ -205,12 +205,15 @@ export class NodeUI extends Component {
// All keybindings is Alt+Shift, since the popular browsers at the time (2023) allows to override thees.
// Ctrl+S is the exception to using Alt+Shift, since it is overridable and in such widespread use for saving.
// Thus, the exception is acceptable to consequent use of alt+shift.
if (!(evt.shiftKey && evt.altKey) && !(evt.key.toUpperCase() == 'S' && evt.ctrlKey))
if (!(evt.shiftKey && evt.altKey) && !(evt.key.toUpperCase() === 'S' && evt.ctrlKey))
return
switch (evt.key.toUpperCase()) {
case 'T':
_notes2.current.tree.treeDiv.current?.focus()
if (document.activeElement.id === 'tree')
document.getElementById('node-content').focus()
else
document.getElementById('tree').focus()
break
/*
case 'C':
@ -260,7 +263,6 @@ export class NodeUI extends Component {
evt.stopPropagation()
}
}//}}}
}
class NodeContent extends Component {