From 4b67ffa7fd75980292bd5b01fab297e593588a37 Mon Sep 17 00:00:00 2001 From: Matilda Haneling Date: Thu, 15 Jan 2026 11:00:31 +0000 Subject: [PATCH] Merged in fix/book-149-datepicker-overflowing (pull request #3433) Fix/optimizations and cleanup of booking widget * fix(BOOK-149):fixed issue with datepicker overflowing on months spanning more weeks * fix(BOOK-149): added smooth scroll to age selector to avoid clipping the selector * cleanup in trigger and css * update to new Button componenet to fix missing focus indicator * included color token in triggerbutton class instead Approved-by: Bianca Widstam Approved-by: Erik Tiekstra --- .../DatePicker/date-picker.module.css | 2 +- .../GuestsRoomsPicker/ChildSelector/index.tsx | 9 ++++++ .../GuestsRoomsPicker/GuestsRoom/index.tsx | 11 +++---- .../guests-rooms-picker.module.css | 14 +++------ .../BookingWidget/GuestsRoomsPicker/index.tsx | 31 +++++++++---------- 5 files changed, 33 insertions(+), 34 deletions(-) diff --git a/packages/booking-flow/lib/components/BookingWidget/DatePicker/date-picker.module.css b/packages/booking-flow/lib/components/BookingWidget/DatePicker/date-picker.module.css index ebd51ec0c..e090ef43a 100644 --- a/packages/booking-flow/lib/components/BookingWidget/DatePicker/date-picker.module.css +++ b/packages/booking-flow/lib/components/BookingWidget/DatePicker/date-picker.module.css @@ -58,7 +58,7 @@ box-shadow: var(--popup-box-shadow); padding: var(--Space-x2) var(--Space-x3); max-width: calc(100vw - 20px); - max-height: 440px; + min-height: 440px; top: calc(100% + 36px); left: auto; right: auto; diff --git a/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/index.tsx b/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/index.tsx index 0b31c2178..fc53ce3f6 100644 --- a/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/index.tsx +++ b/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/index.tsx @@ -1,5 +1,6 @@ "use client" +import { useRef } from "react" import { useFormContext } from "react-hook-form" import { useIntl } from "react-intl" @@ -30,6 +31,7 @@ export default function ChildSelector({ defaultMessage: "Children (0–12 years)", }) const { setValue } = useFormContext() + const agePickerRef = useRef(null) function increaseChildrenCount(roomIndex: number) { if (currentChildren.length < 5) { @@ -67,12 +69,19 @@ export default function ChildSelector({ decreaseChildrenCount(roomIndex) }} handleOnIncrease={() => { + requestAnimationFrame(() => { + agePickerRef.current?.scrollIntoView({ + behavior: "smooth", + block: "center", + }) + }) increaseChildrenCount(roomIndex) }} disableDecrease={currentChildren.length == 0} disableIncrease={currentChildren.length == 5} /> + {currentChildren.map((child, index) => ( {index !== 0 && ( + + + {parts.join(", ")} + + ) }