diff --git a/TaskTracker.Api/wwwroot/js/app.js b/TaskTracker.Api/wwwroot/js/app.js index 3f9ea52..217f678 100644 --- a/TaskTracker.Api/wwwroot/js/app.js +++ b/TaskTracker.Api/wwwroot/js/app.js @@ -111,6 +111,18 @@ // Initialize Kanban drag-and-drop on page load document.addEventListener('DOMContentLoaded', function() { initKanban(); + + // "New Task" header button — scroll to and focus the create-task input in the Pending column + var newTaskBtn = document.getElementById('new-task-trigger'); + if (newTaskBtn) { + newTaskBtn.addEventListener('click', function() { + var input = document.querySelector('.create-task-form input[name="title"]'); + if (input) { + input.scrollIntoView({ behavior: 'smooth', block: 'center' }); + input.focus(); + } + }); + } }); // Re-initialize after htmx swaps that affect the kanban board.