fix(SW-984): Scroll to active card (desktop)

This commit is contained in:
Pontus Dreij
2024-11-25 13:27:19 +01:00
parent 333be1379c
commit 0283c777ca
3 changed files with 25 additions and 8 deletions

View File

@@ -3,4 +3,6 @@
flex-direction: column;
gap: var(--Spacing-x2);
margin-bottom: var(--Spacing-x2);
max-height: 100vh;
overflow-y: auto;
}

View File

@@ -109,13 +109,17 @@ export default function HotelCardListing({
<section className={styles.hotelCards}>
{hotels?.length ? (
hotels.map((hotel) => (
<HotelCard
<div
key={hotel.hotelData.operaId}
hotel={hotel}
type={type}
state={hotel.hotelData.name === activeCard ? "active" : "default"}
onHotelCardHover={onHotelCardHover}
/>
data-active={hotel.hotelData.name === activeCard ? "true" : "false"}
>
<HotelCard
hotel={hotel}
type={type}
state={hotel.hotelData.name === activeCard ? "active" : "default"}
onHotelCardHover={onHotelCardHover}
/>
</div>
))
) : activeFilters ? (
<Alert