fix(SW-1043): added hook with the scroll logic
This commit is contained in:
@@ -42,16 +42,6 @@ export function extractGuestFromUser(user: NonNullable<SafeUser>) {
|
||||
|
||||
export function navigate(step: StepEnum, searchParams: string) {
|
||||
window.history.pushState({ step }, "", `${step}?${searchParams}`)
|
||||
|
||||
const element = document.querySelector(`[data-step='${step}']`)
|
||||
const isMobile = window.matchMedia("(max-width: 768px)").matches
|
||||
if (element && isMobile) {
|
||||
element.addEventListener(
|
||||
"transitionend",
|
||||
() => element?.scrollIntoView({ behavior: "smooth" }),
|
||||
{ once: true }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function checkIsSameBooking(prev: BookingData, next: BookingData) {
|
||||
|
||||
Reference in New Issue
Block a user