fix: tighten stack selection keyboard handling

This commit is contained in:
2026-04-25 01:06:44 +02:00
parent 09e4d94908
commit 98bc887a6e
+8 -6
View File
@@ -114,7 +114,7 @@ function moveStackSelection(direction) {
if (!hasStackSelection()) {
if (direction === 'up') {
ensureValidSelection();
} else {
} else if (direction === 'down') {
reactivateEditOnX();
}
return;
@@ -123,11 +123,6 @@ function moveStackSelection(direction) {
const nextIndex = direction === 'up' ? stackCursor + 1 : stackCursor - 1;
if (calc.isValidIndex(nextIndex)) {
stackCursor = nextIndex;
return;
}
if (direction === 'down' && stackCursor === 0) {
reactivateEditOnX();
}
}
@@ -352,6 +347,13 @@ function handleKeydown(event) {
if (isMovingStackItem) {
event.preventDefault();
cancelMoveMode();
clearStackSelection();
render();
return;
}
if (hasStackSelection()) {
event.preventDefault();
clearStackSelection();
render();
}
return;