From c44fb074aba8a97e261a2b0e294f8b84353b4a21 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Fri, 5 Jan 2024 21:37:17 +0530 Subject: [PATCH] fix: Mobile scrolling issue (#13049) --- packages/features/bookings/Booker/Booker.tsx | 6 ------ .../bookings/Booker/components/AvailableTimeSlots.tsx | 9 +-------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/features/bookings/Booker/Booker.tsx b/packages/features/bookings/Booker/Booker.tsx index 425a558f3d..fa16e1398a 100644 --- a/packages/features/bookings/Booker/Booker.tsx +++ b/packages/features/bookings/Booker/Booker.tsx @@ -186,12 +186,6 @@ const BookerComponent = ({ return setBookerState("booking"); }, [event, selectedDate, selectedTimeslot, setBookerState]); - useEffect(() => { - if (layout === "mobile") { - timeslotsRef.current?.scrollIntoView({ behavior: "smooth" }); - } - }, [layout]); - const hideEventTypeDetails = isEmbed ? embedUiConfig.hideEventTypeDetails : false; if (entity.isUnpublished) { diff --git a/packages/features/bookings/Booker/components/AvailableTimeSlots.tsx b/packages/features/bookings/Booker/components/AvailableTimeSlots.tsx index f2d40e3654..e01b40ef1e 100644 --- a/packages/features/bookings/Booker/components/AvailableTimeSlots.tsx +++ b/packages/features/bookings/Booker/components/AvailableTimeSlots.tsx @@ -1,4 +1,4 @@ -import { useRef, useEffect } from "react"; +import { useRef } from "react"; import dayjs from "@calcom/dayjs"; import { useIsEmbed } from "@calcom/embed-core/embed-iframe"; @@ -93,13 +93,6 @@ export const AvailableTimeSlots = ({ const slotsPerDay = useSlotsForAvailableDates(dates, schedule?.data?.slots); - useEffect(() => { - if (isEmbed) return; - if (containerRef.current && !schedule.isLoading && isMobile) { - containerRef.current.scrollIntoView({ behavior: "smooth", block: "center" }); - } - }, [containerRef, schedule.isLoading, isEmbed, isMobile]); - return ( <>