Merge pull request #11862 from hurxxxx/feat/auto-edit-new-folder

feat: Automatically enter edit mode when creating a new folder
This commit is contained in:
Timothy Jaeryang Baek
2025-03-20 17:40:37 -07:00
committed by GitHub
2 changed files with 20 additions and 2 deletions
@@ -215,6 +215,14 @@
// Event listener for when dragging ends
folderElement.addEventListener('dragend', onDragEnd);
}
if (folders[folderId].isNew) {
folders[folderId].isNew = false;
setTimeout(() => {
editHandler();
}, 100);
}
});
onDestroy(() => {
@@ -301,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);
};