diff --git a/apps/web/components/booking/CancelBooking.tsx b/apps/web/components/booking/CancelBooking.tsx index bde168f0ac..dece688720 100644 --- a/apps/web/components/booking/CancelBooking.tsx +++ b/apps/web/components/booking/CancelBooking.tsx @@ -1,5 +1,5 @@ import { useRouter } from "next/router"; -import { useState } from "react"; +import { useCallback, useState } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useTheme from "@calcom/lib/hooks/useTheme"; @@ -36,6 +36,13 @@ export default function CancelBooking(props: Props) { const [error, setError] = useState(booking ? null : t("booking_already_cancelled")); useTheme(props.theme); + const cancelBookingRef = useCallback((node: HTMLTextAreaElement) => { + if (node !== null) { + node.scrollIntoView({ behavior: "smooth" }); + node.focus(); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); return ( <> {error && ( @@ -54,6 +61,7 @@ export default function CancelBooking(props: Props) {