feat(web): add "New Task" button scroll-to-input behavior
Clicking the header "New Task" button now scrolls to and focuses the create-task input in the Pending column. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user