fix: tighten stack selection keyboard handling
This commit is contained in:
@@ -114,7 +114,7 @@ function moveStackSelection(direction) {
|
|||||||
if (!hasStackSelection()) {
|
if (!hasStackSelection()) {
|
||||||
if (direction === 'up') {
|
if (direction === 'up') {
|
||||||
ensureValidSelection();
|
ensureValidSelection();
|
||||||
} else {
|
} else if (direction === 'down') {
|
||||||
reactivateEditOnX();
|
reactivateEditOnX();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -123,11 +123,6 @@ function moveStackSelection(direction) {
|
|||||||
const nextIndex = direction === 'up' ? stackCursor + 1 : stackCursor - 1;
|
const nextIndex = direction === 'up' ? stackCursor + 1 : stackCursor - 1;
|
||||||
if (calc.isValidIndex(nextIndex)) {
|
if (calc.isValidIndex(nextIndex)) {
|
||||||
stackCursor = nextIndex;
|
stackCursor = nextIndex;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (direction === 'down' && stackCursor === 0) {
|
|
||||||
reactivateEditOnX();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,6 +347,13 @@ function handleKeydown(event) {
|
|||||||
if (isMovingStackItem) {
|
if (isMovingStackItem) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
cancelMoveMode();
|
cancelMoveMode();
|
||||||
|
clearStackSelection();
|
||||||
|
render();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (hasStackSelection()) {
|
||||||
|
event.preventDefault();
|
||||||
|
clearStackSelection();
|
||||||
render();
|
render();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user