feat(KB-219): auto-focus description textarea in NewTaskModal
- Add auto-focus to description textarea when NewTaskModal opens\n- Add test to verify textarea receives focus on modal open\n- Focus management improves UX by allowing immediate typing
This commit is contained in:
@@ -327,6 +327,17 @@ export function NewTaskModal({ isOpen, onClose, tasks, onCreateTask, addToast, o
|
||||
setHasDirtyState(isDirty);
|
||||
}, [description, dependencies, pendingImages, executorModel, validatorModel, enablePlanningMode]);
|
||||
|
||||
// Auto-focus description textarea when modal opens
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
// Small delay to ensure modal is fully rendered
|
||||
const timeoutId = setTimeout(() => {
|
||||
descTextareaRef.current?.focus();
|
||||
}, 0);
|
||||
return () => clearTimeout(timeoutId);
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
useEffect(() => {
|
||||
if (!showDepDropdown) return;
|
||||
|
||||
Reference in New Issue
Block a user