From 7aa64db983b557c5c167148513c4d1ab785f44df Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 18 Mar 2024 22:40:24 +0000 Subject: [PATCH] feat: glass modal --- .../boards/[...boardId]/components/NewCardForm.tsx | 12 +++++++++--- .../boards/[...boardId]/components/NewListForm.tsx | 4 ++-- src/app/boards/components/NewBoardForm.tsx | 4 ++-- src/app/components/dashboard.tsx | 2 +- src/app/components/modal.tsx | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) 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