feat: enable editing from the down button in calc sample

This commit is contained in:
2026-05-15 20:24:21 +02:00
parent 40e1043a03
commit 02b3b280f8
+11 -1
View File
@@ -356,7 +356,17 @@ constButton.addEventListener('click', (event) => {
leftButton.addEventListener('click', () => {});
downButton.addEventListener('click', () => {});
downButton.addEventListener('click', () => {
if (!calc.isEditing && calc.isValidIndex(0)) {
const value = calc.stack[0];
calc.remove(0);
calc.isEditing = true;
calc.inputValue = calc.formatNumber(value);
render();
focusInput();
}
});
rightButton.addEventListener('click', () => {
execute('swap');