fix(SW-1111) fix filter button and filter flimmer in mobile

This commit is contained in:
Pontus Dreij
2024-12-10 09:30:58 +01:00
parent 15c5afc43a
commit f8d10d7b8c
5 changed files with 14 additions and 4 deletions

View File

@@ -2,7 +2,6 @@
min-height: 100dvh;
background-color: var(--Base-Background-Primary-Normal);
position: relative;
z-index: var(--header-z-index);
}
@media screen and (min-width: 768px) {

View File

@@ -65,7 +65,9 @@ export default function FilterAndSortModal({
const handleApplyFiltersAndSorting = useCallback(
(close: () => void) => {
if (sort === searchParams.get("sort")) return
if (sort === searchParams.get("sort")) {
close()
}
const newSearchParams = new URLSearchParams(searchParams)
newSearchParams.set("sort", sort)

View File

@@ -1,6 +1,6 @@
.container {
max-width: var(--max-width);
height: 100%;
height: 100vh;
display: flex;
width: 100%;
}
@@ -29,6 +29,9 @@
}
@media (min-width: 768px) {
.container {
height: 100%;
}
.listingContainer {
background-color: var(--Base-Surface-Secondary-light-Normal);
padding: var(--Spacing-x3) var(--Spacing-x4);

View File

@@ -9,6 +9,7 @@ import styles from "./mapModal.module.css"
export function MapContainer({ children }: { children: React.ReactNode }) {
const [mapHeight, setMapHeight] = useState("0px")
const [mapTop, setMapTop] = useState("0px")
const [mapZIndex, setMapZIndex] = useState(0)
const [scrollHeightWhenOpened, setScrollHeightWhenOpened] = useState(0)
const rootDiv = useRef<HTMLDivElement | null>(null)
@@ -19,6 +20,7 @@ export function MapContainer({ children }: { children: React.ReactNode }) {
const scrollY = window.scrollY
setMapHeight(`calc(100dvh - ${topPosition + scrollY}px)`)
setMapTop(`${topPosition + scrollY}px`)
setMapZIndex(11)
}, [])
useEffect(() => {
@@ -92,6 +94,7 @@ export function MapContainer({ children }: { children: React.ReactNode }) {
{
"--hotel-map-height": mapHeight,
"--hotel-map-top": mapTop,
"--hotel-dynamic-map-z-index": mapZIndex,
} as React.CSSProperties
}
className={styles.dynamicMap}

View File

@@ -1,6 +1,7 @@
.dynamicMap {
--hotel-map-height: 100dvh;
--hotel-map-top: 0px;
--hotel-map-top: 145px;
--hotel-dynamic-map-z-index: 2;
position: fixed;
top: var(--hotel-map-top);
left: 0;
@@ -15,4 +16,6 @@
position: absolute;
top: 0;
left: 0;
height: 100vh;
right: 0;
}