Merged in fix/SW-3553-logged-in-details- (pull request #3073)

* fix(SW-3553): Fixed screen scolled & locked on click of menu

Approved-by: Joakim Jäderberg
This commit is contained in:
Hrishikesh Vaipurkar
2025-11-07 10:30:45 +00:00
parent 28ae796b8c
commit fd92afc015

View File

@@ -117,7 +117,7 @@ export default function BookingAlert({ isVisible = false }: BookingAlertProps) {
errorCode === BookingErrorCodeEnum.NoAvailabilityForRateAndRoomType
const ref = useRef<HTMLDivElement>(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) {