diff --git a/src/app/boards/[...boardId]/components/NewCardForm.tsx b/src/app/boards/[...boardId]/components/NewCardForm.tsx index d260b7e3..22606d72 100644 --- a/src/app/boards/[...boardId]/components/NewCardForm.tsx +++ b/src/app/boards/[...boardId]/components/NewCardForm.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { useState, useEffect } from "react"; import { api } from "~/trpc/react"; import { HiXMark } from "react-icons/hi2"; @@ -43,12 +43,18 @@ export function NewCardForm({ listPublicId }: listPublicId) { }, }); + useEffect(() => { + const titleElement: HTMLElement | null = + document?.querySelector("#title"); + if (titleElement) titleElement.focus(); + }, []); + return ( <>
-

New card

+

New card