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;