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

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
pull/8217/head
Mohd Afzal Khan 2023-05-02 23:50:03 +05:30 committed by GitHub
parent ada88a2f7e
commit 5ad45900ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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) => {