From 98bc887a6ea807d339f41421d8e0d754661992c2 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 25 Apr 2026 01:06:44 +0200 Subject: [PATCH] fix: tighten stack selection keyboard handling --- samples/dev/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/samples/dev/index.js b/samples/dev/index.js index aa2590b..ce86fa2 100644 --- a/samples/dev/index.js +++ b/samples/dev/index.js @@ -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;