From 4b684912f76b17d1876465a04e4a077d8c5375d2 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Fri, 24 Apr 2026 22:34:43 +0200 Subject: [PATCH] fix: preserve x value when re-entering edit mode --- samples/dev/index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/dev/index.html b/samples/dev/index.html index 609054f..813546f 100644 --- a/samples/dev/index.html +++ b/samples/dev/index.html @@ -372,7 +372,10 @@ function reactivateEditOnX() { clearStackSelection(); if (calc.isValidIndex(0)) { - calc.edit(0); + const value = getStackValue(0); + calc.remove(0); + calc.inputValue = calc.formatNumber(value); + calc.isEditing = true; } else { calc.inputValue = ''; calc.isEditing = true; @@ -397,7 +400,7 @@ } if (direction === 'down' && stackCursor === 0) { - clearStackSelection(); + reactivateEditOnX(); } }