diff --git a/frontend/src/routes/memos/+page.svelte b/frontend/src/routes/memos/+page.svelte index b3d76a2..e807f3e 100644 --- a/frontend/src/routes/memos/+page.svelte +++ b/frontend/src/routes/memos/+page.svelte @@ -125,7 +125,16 @@ function addDueDate() { const ta = document.querySelector('[data-memo-input]'); - insertAtCursor(ta, ` @${todayIso()}`); + if (!ta) return; + const start = ta.selectionStart; + const end = ta.selectionEnd; + const ins = ` @${todayIso()}`; + newContent = newContent.slice(0, start) + ins + newContent.slice(end); + requestAnimationFrame(() => { + const pos = start + ins.length; + ta.focus(); + ta.setSelectionRange(pos, pos); + }); } // 편집 모드 툴바