diff --git a/templates/rooms/room.html b/templates/rooms/room.html index d47f95c..c867cbb 100644 --- a/templates/rooms/room.html +++ b/templates/rooms/room.html @@ -1140,6 +1140,10 @@ function showRenameModal(filename) { } var modal = new bootstrap.Modal(document.getElementById('renameModal')); modal.show(); + // Focus the input field after the modal is shown + setTimeout(() => { + document.getElementById('renameInput').focus(); + }, 100); } document.getElementById('confirmRenameBtn').addEventListener('click', function() { @@ -1370,6 +1374,10 @@ document.addEventListener('DOMContentLoaded', function() { document.getElementById('folderNameInput').value = ''; document.getElementById('folderError').textContent = ''; newFolderModal.show(); + // Focus the input field after the modal is shown + setTimeout(() => { + document.getElementById('folderNameInput').focus(); + }, 100); }); // Add click handler for create folder button