diff --git a/packages/booking-flow/lib/components/EnterDetails/Payment/BookingAlert/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Payment/BookingAlert/index.tsx index 4a39d1532..a1471109b 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Payment/BookingAlert/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Payment/BookingAlert/index.tsx @@ -117,7 +117,7 @@ export default function BookingAlert({ isVisible = false }: BookingAlertProps) { errorCode === BookingErrorCodeEnum.NoAvailabilityForRateAndRoomType const ref = useRef(null) - const { getTopOffset } = useStickyPosition() + const topOffset = useStickyPosition().getTopOffset() useEffect(() => { if (isVisible) { @@ -131,11 +131,11 @@ export default function BookingAlert({ isVisible = false }: BookingAlertProps) { if (showAlert && el) { document.documentElement.style.overflow = "" window.scrollTo({ - top: el.offsetTop - getTopOffset(), + top: el.offsetTop - topOffset, behavior: "smooth", }) } - }, [showAlert, getTopOffset]) + }, [showAlert, topOffset]) useEffect(() => { if (showAlert && isAvailabilityError) {