Fix/SW-2682 map fixes

* fix(SW-2682): Added overflow-y: hidden to body on destination and hotel map pages
* fix(SW-2682): Added scroll to top functionality on map components with reason why

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-05-14 12:06:41 +00:00
parent a66b632875
commit 211cd5270b
5 changed files with 71 additions and 28 deletions

View File

@@ -46,6 +46,9 @@ export default function BookingWidgetClient({
const [isOpen, setIsOpen] = useState(false)
const bookingWidgetRef = useRef(null)
const lang = useLang()
const [originalOverflowY, setOriginalOverflowY] = useState<string | null>(
null
)
const params = convertSearchParamsToObj<BookingWidgetSearchData>(
bookingWidgetSearchParams
@@ -147,11 +150,13 @@ export default function BookingWidgetClient({
function closeMobileSearch() {
setIsOpen(false)
document.body.style.overflowY = "visible"
const overflowY = originalOverflowY ?? "visible"
document.body.style.overflowY = overflowY
}
function openMobileSearch() {
setIsOpen(true)
setOriginalOverflowY(document.body.style.overflowY)
document.body.style.overflowY = "hidden"
}