fix(memos): 마감일 버튼 줄바꿈 없이 커서 옆에 삽입

insertAtCursor가 자동 줄바꿈 추가해서 마감일이 아랫줄에 생성됨.
직접 삽입으로 변경하여 현재 커서 위치 바로 옆에 @날짜 삽입.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-14 15:46:37 +09:00
parent 804ba1f4c7
commit d6756010b1
+10 -1
View File
@@ -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);
});
}
// 편집 모드 툴바