fix: Mobile scrolling issue (#13049)

This commit is contained in:
Udit Takkar 2024-01-05 21:37:17 +05:30 committed by GitHub
parent d56d649bf0
commit c44fb074ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions

View File

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

View File

@ -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 (
<>
<div className="flex">