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:
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user