further improved keyboard handling

This commit is contained in:
Joeri Exelmans 2025-05-13 00:15:47 +02:00
parent 95eb8aef84
commit fa70d2f3f4
5 changed files with 38 additions and 13 deletions

View file

@ -75,10 +75,14 @@ export function Editor({state, setState, onResolve, onCancel, filter, focus}: Ed
e.preventDefault();
setNeedCommand(false);
// u -> pass Up
if (e.key === "u" || e.key === "Enter" || e.key === "Tab") {
if (e.key === "u" || e.key === "Enter" || e.key === "Tab" && !e.shiftKey) {
onResolve(state);
return;
}
if (e.key === "Tab" && e.shiftKey) {
setNeedCommand(false);
focusPrevElement();
}
// c -> Call
if (e.key === "c") {
// we become CallBlock