fix: Enter key confirms edit (Shift+Enter for newline)
Edit textarea now mirrors composer behavior: - Enter alone → save the edit - Shift+Enter → insert newline - Escape → cancel edit
This commit is contained in:
@@ -108,7 +108,8 @@ function renderPendingCard(item, index) {
|
|||||||
|
|
||||||
editTA.addEventListener('keydown', (e) => {
|
editTA.addEventListener('keydown', (e) => {
|
||||||
if (e.key === 'Escape') { e.preventDefault(); hideEdit(); }
|
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 () => {
|
saveBtn.addEventListener('click', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user