fix the auto-focus issue in teams setting page (#8577)
Co-authored-by: Keith Williams <keithwillcode@gmail.com>pull/8217/head
parent
ada88a2f7e
commit
5ad45900ea
|
@ -3,7 +3,7 @@ import type { Prisma } from "@prisma/client";
|
||||||
import { useSession } from "next-auth/react";
|
import { useSession } from "next-auth/react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useState } from "react";
|
import { useState, useLayoutEffect } from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -55,6 +55,10 @@ const ProfileView = () => {
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const [firstRender, setFirstRender] = useState(true);
|
const [firstRender, setFirstRender] = useState(true);
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
document.body.focus();
|
||||||
|
}, []);
|
||||||
|
|
||||||
const mutation = trpc.viewer.teams.update.useMutation({
|
const mutation = trpc.viewer.teams.update.useMutation({
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
showToast(err.message, "error");
|
showToast(err.message, "error");
|
||||||
|
|
Loading…
Reference in New Issue