Skip to content

Commit 8f052c0

Browse files
committed
Fix commit dialog backspace bug
- place curstor at end of commit title when backspacing from empty description
1 parent f67744e commit 8f052c0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/lib/commit/CommitMessageInput.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@
161161
const value = e.currentTarget.value;
162162
if (e.key === 'Backspace' && value.length === 0) {
163163
e.preventDefault();
164-
titleTextArea?.focus();
164+
if (titleTextArea) {
165+
titleTextArea?.focus();
166+
titleTextArea.selectionStart = titleTextArea.textLength;
167+
}
165168
useAutoHeight(e.currentTarget);
166169
} else if (e.key === 'a' && (e.metaKey || e.ctrlKey) && value.length === 0) {
167170
// select previous textarea on cmd+a if this textarea is empty

0 commit comments

Comments
 (0)