From b19dd3ccd96ca7fa505f00c1319caff93900fc4a Mon Sep 17 00:00:00 2001 From: coderw Date: Fri, 28 Feb 2025 15:06:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3storage=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9key=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/storage/storage.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/storage.svelte b/src/storage/storage.svelte index b9dd214f..7a2e8780 100644 --- a/src/storage/storage.svelte +++ b/src/storage/storage.svelte @@ -41,10 +41,11 @@ await model.removeItem(key); }; const onTapSave = async (key: string) => { + model.setItem(editingKey, editingVal); // set value anyway if (editingKey !== key) { await model.removeItem(key); // dirty key } - model.setItem(editingKey, editingVal); // set value anyway + resetEditState(); // reset editing status }; const onTapEdit = async (key: string, value: string, i: number) => { @@ -77,7 +78,7 @@
{k}
{properDisplay(v)}
{/if} - +
{#if editingIdx === i}