From bf82427ebbdfe19360fb9f9551d4dba11bb30661 Mon Sep 17 00:00:00 2001 From: Chris McCormick Date: Sun, 4 Jan 2026 17:08:45 +0800 Subject: [PATCH] Fix plus button disappearing on cancel. --- index.html | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 92288ef..a9da69e 100644 --- a/index.html +++ b/index.html @@ -988,7 +988,7 @@ chmod 755 kbtd $(`#${containerId}`).appendChild(clone); } - function createAddForm(placeholder, onSubmit) { + function createAddForm(placeholder, onSubmit, onCancel) { const input = h('input', { type: 'text', placeholder }); const form = h('div', { className: 'add-card-form' }, input); @@ -1012,7 +1012,10 @@ chmod 755 kbtd h('button', { textContent: 'Add', onclick: handleSubmit }), h('button', { textContent: 'Cancel', - onclick: () => form.hide() + onclick: () => { + form.hide(); + if (onCancel) onCancel(); + } }) ); @@ -2001,12 +2004,6 @@ chmod 755 kbtd ondragleave: handleDragLeave }, ...cardElements); - const addCardForm = createAddForm('Card text...', async (text) => { - await createCard(colIndex, text); - addCardForm.hide(); - addCardBtn.style.display = ''; - }); - const addCardBtn = h('button', { className: 'add-card-btn', textContent: '+', @@ -2017,6 +2014,14 @@ chmod 755 kbtd } }); + const addCardForm = createAddForm('Card text...', async (text) => { + await createCard(colIndex, text); + addCardForm.hide(); + addCardBtn.style.display = ''; + }, () => { + addCardBtn.style.display = ''; + }); + return h('div', { className: 'column', dataset: { colIndex }