From bebf6c99c365c1661f84c7deab2c45393f2f8fea Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Fri, 24 Jan 2025 13:15:10 +0000 Subject: [PATCH] Merged in fix/SW-1482-done-button-disabled (pull request #1205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(SW-1482): done disabled in booking widget if no child age entered * fix(SW-1482): done disabled in booking widget if no child age entered Approved-by: Niclas Edenvin Approved-by: Matilda Landström --- components/GuestsRoomsPicker/Form.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/GuestsRoomsPicker/Form.tsx b/components/GuestsRoomsPicker/Form.tsx index 4f0daed23..11d4dfb03 100644 --- a/components/GuestsRoomsPicker/Form.tsx +++ b/components/GuestsRoomsPicker/Form.tsx @@ -70,7 +70,11 @@ export default function GuestsRoomsPickerDialog({ if (fieldState.invalid) trigger("rooms") }, [roomsValue, getFieldState, trigger]) - const isInvalid = getFieldState("rooms").invalid + const isInvalid = + getFieldState("rooms").invalid || + roomsValue.some((room) => + room.childrenInRoom.some((child) => child.age === undefined) + ) const canAddRooms = rooms.length < MAX_ROOMS return (