fix(BOOK-498): removed and changed z-index values to have booking widget overlapping correctly on mobile.

Approved-by: Bianca Widstam
Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Erik Tiekstra
2025-11-07 13:03:25 +00:00
parent 0d479eb337
commit cab85f3ffd
12 changed files with 43 additions and 45 deletions

View File

@@ -15,6 +15,7 @@
); );
--sitewide-alert-height: 0px; /* Will be overridden when a sitewide alert is visible */ --sitewide-alert-height: 0px; /* Will be overridden when a sitewide alert is visible */
--sitewide-alert-sticky-height: 0px; /* Will be overridden when a sticky sitewide alert is visible */
--campaign-banner-height: 0px; /* Will be overridden when a campaign banner is visible */ --campaign-banner-height: 0px; /* Will be overridden when a campaign banner is visible */
--alert-and-banner-height: calc( --alert-and-banner-height: calc(
var(--sitewide-alert-height) + var(--campaign-banner-height) var(--sitewide-alert-height) + var(--campaign-banner-height)

View File

@@ -1,6 +1,5 @@
.campaignBanner { .campaignBanner {
width: 100%; width: 100%;
z-index: var(--header-z-index);
position: relative; position: relative;
background-color: var(--Surface-Brand-Primary-3-Default); background-color: var(--Surface-Brand-Primary-3-Default);
} }

View File

@@ -48,7 +48,7 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
height: calc(100dvh - max(var(--alert-and-banner-height), 20px)); height: calc(100dvh - max(var(--sitewide-alert-sticky-height), 20px));
border-radius: var(--Corner-radius-md) var(--Corner-radius-md) 0 0; border-radius: var(--Corner-radius-md) var(--Corner-radius-md) 0 0;
background-color: var(--Surface-Primary-Default); background-color: var(--Surface-Primary-Default);
box-shadow: 0px 0px 14px 6px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 14px 6px rgba(0, 0, 0, 0.1);

View File

@@ -1,7 +1,6 @@
.header { .header {
height: 560px; height: 560px;
position: relative; position: relative;
z-index: 10;
} }
.header:after { .header:after {
@@ -19,7 +18,6 @@
color: var(--Text-Inverted); color: var(--Text-Inverted);
position: absolute; position: absolute;
inset: 0; inset: 0;
z-index: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -9,7 +9,7 @@
overflow-y: auto; overflow-y: auto;
padding: var(--Spacing-x2) var(--Spacing-x3); padding: var(--Spacing-x2) var(--Spacing-x3);
position: fixed; position: fixed;
top: calc(140px + max(var(--alert-and-banner-height), 25px)); top: calc(140px + max(var(--sitewide-alert-sticky-height), 25px));
width: 100%; width: 100%;
height: calc(100% - 200px); height: calc(100% - 200px);
z-index: 10010; z-index: 10010;

View File

@@ -257,8 +257,8 @@ export default function BookingWidgetClient({
</button> </button>
<Form type={type} onClose={closeMobileSearch} /> <Form type={type} onClose={closeMobileSearch} />
</div> </div>
<div className={styles.backdrop} onClick={closeMobileSearch} />
</section> </section>
<div className={styles.backdrop} onClick={closeMobileSearch} />
</FormProvider> </FormProvider>
) )
} }

View File

@@ -46,7 +46,7 @@
.container[data-datepicker-open="true"] .hideWrapper { .container[data-datepicker-open="true"] .hideWrapper {
border-radius: var(--Corner-radius-lg) var(--Corner-radius-lg) 0 0; border-radius: var(--Corner-radius-lg) var(--Corner-radius-lg) 0 0;
top: calc(max(var(--alert-and-banner-height), 20px)); top: calc(max(var(--sitewide-alert-sticky-height), 20px));
} }
} }

View File

@@ -2,7 +2,6 @@
width: var(--max-width-content); width: var(--max-width-content);
margin: 0 auto; margin: 0 auto;
min-height: 88px; min-height: 88px;
z-index: 1000;
position: relative; position: relative;
.floatingBackground { .floatingBackground {
@@ -20,7 +19,7 @@
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 1000; z-index: var(--booking-widget-z-index);
margin-top: var(--sitewide-alert-sticky-height); margin-top: var(--sitewide-alert-sticky-height);
box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.05); box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.05);
} }

View File

@@ -22,7 +22,7 @@
left: 0; left: 0;
position: fixed; position: fixed;
right: 0; right: 0;
top: 20px; top: calc(max(var(--sitewide-alert-sticky-height), 20px));
transition: top 300ms ease; transition: top 300ms ease;
z-index: 100; z-index: 100;
} }

View File

@@ -1,5 +1,5 @@
.complete, .mobileToggleButton {
.partial { position: relative;
border: none; border: none;
align-items: center; align-items: center;
box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.16); box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.16);
@@ -7,7 +7,6 @@
display: grid; display: grid;
gap: var(--Space-x15); gap: var(--Space-x15);
padding: var(--Spacing-x2); padding: var(--Spacing-x2);
z-index: 1;
background-color: var(--Base-Surface-Primary-light-Normal); background-color: var(--Base-Surface-Primary-light-Normal);
width: 100%; width: 100%;
/* In some cases the lingering pressend event will trigger the */ /* In some cases the lingering pressend event will trigger the */
@@ -60,8 +59,7 @@
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.complete, .mobileToggleButton {
.partial {
display: none; display: none;
} }
} }

View File

@@ -1,5 +1,6 @@
"use client" "use client"
import { cx } from "class-variance-authority"
import { Button } from "react-aria-components" import { Button } from "react-aria-components"
import { useWatch } from "react-hook-form" import { useWatch } from "react-hook-form"
import { useIntl } from "react-intl" import { useIntl } from "react-intl"
@@ -96,7 +97,10 @@ export default function MobileToggleButton({
return ( return (
<Button <Button
className={locationAndDateIsSet ? styles.complete : styles.partial} className={cx(
styles.mobileToggleButton,
locationAndDateIsSet ? styles.complete : styles.partial
)}
onPress={openMobileSearch} onPress={openMobileSearch}
> >
{!locationAndDateIsSet && ( {!locationAndDateIsSet && (
@@ -185,7 +189,7 @@ export function MobileToggleButtonSkeleton() {
const intl = useIntl() const intl = useIntl()
return ( return (
<div className={styles.partial}> <div className={cx(styles.mobileToggleButton, styles.partial)}>
<span className={styles.block}> <span className={styles.block}>
<Typography variant={"Body/Supporting text (caption)/smBold"}> <Typography variant={"Body/Supporting text (caption)/smBold"}>
<span className={styles.blockLabel}> <span className={styles.blockLabel}>

View File

@@ -2,11 +2,30 @@
position: sticky; position: sticky;
z-index: var(--booking-widget-z-index); z-index: var(--booking-widget-z-index);
width: 100%; width: 100%;
}
/* Make sure Date Picker is placed on top of other sticky/fixed components */ &[data-booking-widget-open="true"] {
.wrapper:has([data-datepicker-open="true"]) { z-index: var(--booking-widget-open-z-index);
z-index: 100; overflow-y: visible;
.formContainer {
left: 0;
bottom: 0;
width: 100%;
z-index: 1;
}
.backdrop {
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 0;
}
}
/* Make sure Date Picker is placed on top of other sticky/fixed components */
&:has([data-datepicker-open="true"]) {
z-index: var(--booking-widget-open-z-index);
}
} }
.formContainer { .formContainer {
@@ -15,7 +34,7 @@
background-color: var(--UI-Input-Controls-Surface-Normal); background-color: var(--UI-Input-Controls-Surface-Normal);
border-radius: 0; border-radius: 0;
gap: var(--Spacing-x3); gap: var(--Spacing-x3);
height: calc(100dvh - max(var(--alert-and-banner-height), 20px)); height: calc(100dvh - max(var(--sitewide-alert-sticky-height), 20px));
width: 100%; width: 100%;
padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x7); padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x7);
position: fixed; position: fixed;
@@ -23,10 +42,10 @@
bottom: -100%; bottom: -100%;
overflow-y: auto; overflow-y: auto;
transition: bottom 300ms ease; transition: bottom 300ms ease;
}
.formContainer:has([data-searchlist-open="true"]) { &:has([data-searchlist-open="true"]) {
overflow-y: visible; overflow-y: visible;
}
} }
.compact { .compact {
@@ -41,16 +60,6 @@
} }
} }
.wrapper[data-booking-widget-open="true"] {
z-index: var(--booking-widget-open-z-index);
overflow-y: visible;
}
.wrapper[data-booking-widget-open="true"] .formContainer {
left: 0;
bottom: 0;
}
.close { .close {
background: none; background: none;
border: none; border: none;
@@ -59,16 +68,6 @@
padding: 0; padding: 0;
} }
.wrapper[data-booking-widget-open="true"] + .backdrop {
background-color: rgba(0, 0, 0, 0.4);
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: calc(var(--booking-widget-open-z-index) - 1);
}
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.wrapper { .wrapper {
top: 0; top: 0;