Browse Source

fix: Enter edit mode with text pre-selected

hurxxxx 3 months ago
parent
commit
18a8a375ab
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/lib/components/layout/Sidebar/RecursiveFolder.svelte

+ 5 - 2
src/lib/components/layout/Sidebar/RecursiveFolder.svelte

@@ -309,10 +309,13 @@
 
 		await tick();
 
-		// focus on the input
+		// focus on the input and select all text
 		setTimeout(() => {
 			const input = document.getElementById(`folder-${folderId}-input`);
-			input.focus();
+			if (input) {
+				input.focus();
+				input.select();
+			}
 		}, 100);
 	};