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:
@@ -65,6 +65,15 @@ describe("NewTaskModal", () => {
|
||||
expect(screen.getByRole("button", { name: "Cancel" })).toBeTruthy();
|
||||
});
|
||||
|
||||
it("focuses description textarea when modal opens", async () => {
|
||||
renderNewTaskModal();
|
||||
|
||||
const descTextarea = screen.getByLabelText(/Description/i);
|
||||
await waitFor(() => {
|
||||
expect(descTextarea).toHaveFocus();
|
||||
});
|
||||
});
|
||||
|
||||
it("creates task with description on submit", async () => {
|
||||
const { props } = renderNewTaskModal();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user