fix the auto-focus issue in teams setting page (#8577)

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
This commit is contained in:
Mohd Afzal KhanandKeith Williams authored and GitHub committed 2023-05-02 15:20:03 -03:00
1 parent ada88a2f7e
commit 5ad45900ea
1 file changed
+5 -1
@@ -3,7 +3,7 @@ import type { Prisma } from "@prisma/client";
import { useSession } from "next-auth/react";
import Link from "next/link";
import { useRouter } from "next/router";
import { useState } from "react";
import { useState, useLayoutEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { z } from "zod";
@@ -54,6 +54,10 @@ const ProfileView = () => {
const utils = trpc.useContext();
const session = useSession();
const [firstRender, setFirstRender] = useState(true);
useLayoutEffect(() => {
document.body.focus();
}, []);
const mutation = trpc.viewer.teams.update.useMutation({
onError: (err) => {