fix: preserve x value when re-entering edit mode

This commit is contained in:
2026-04-24 22:34:43 +02:00
parent f8d2fc94d6
commit 4b684912f7
+5 -2
View File
@@ -372,7 +372,10 @@
function reactivateEditOnX() { function reactivateEditOnX() {
clearStackSelection(); clearStackSelection();
if (calc.isValidIndex(0)) { if (calc.isValidIndex(0)) {
calc.edit(0); const value = getStackValue(0);
calc.remove(0);
calc.inputValue = calc.formatNumber(value);
calc.isEditing = true;
} else { } else {
calc.inputValue = ''; calc.inputValue = '';
calc.isEditing = true; calc.isEditing = true;
@@ -397,7 +400,7 @@
} }
if (direction === 'down' && stackCursor === 0) { if (direction === 'down' && stackCursor === 0) {
clearStackSelection(); reactivateEditOnX();
} }
} }