From 7de4a03d94a805fb0497a20a5429eb460455829c Mon Sep 17 00:00:00 2001 From: cabbage Date: Fri, 27 Mar 2026 04:17:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Enter=20key=20confirms=20edit=20(Shift+E?= =?UTF-8?q?nter=20for=20newline)=20Edit=20textarea=20now=20mirrors=20compo?= =?UTF-8?q?ser=20behavior:=20-=20Enter=20alone=20=E2=86=92=20save=20the=20?= =?UTF-8?q?edit=20-=20Shift+Enter=20=E2=86=92=20insert=20newline=20-=20Esc?= =?UTF-8?q?ape=20=E2=86=92=20cancel=20edit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/instructions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/instructions.js b/static/js/instructions.js index c681f63..420c191 100644 --- a/static/js/instructions.js +++ b/static/js/instructions.js @@ -108,7 +108,8 @@ function renderPendingCard(item, index) { editTA.addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.preventDefault(); hideEdit(); } - if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') { e.preventDefault(); saveBtn.click(); } + if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); saveBtn.click(); } + // Shift+Enter → default browser behaviour (newline) }); saveBtn.addEventListener('click', async () => {