diff --git a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx index 49b8a3513..409301a6a 100644 --- a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx +++ b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx @@ -44,6 +44,7 @@ export default function BookingCode() { const codeVoucher = intl.formatMessage({ id: "Code / Voucher" }) const addCode = intl.formatMessage({ id: "Add code" }) const ref = useRef(null) + const removeExtraRoomsText = intl.formatMessage({ id: "Remove extra rooms" }) function updateBookingCodeFormValue(value: string) { setValue("bookingCode.value", value, { shouldValidate: true }) @@ -56,8 +57,7 @@ export default function BookingCode() { target && !ref.current.contains(target) && // This is for mobile layout having "Remove extra rooms" button outside the container - target.getAttribute("value") !== - intl.formatMessage({ id: "Remove extra rooms" }) + target.innerText !== removeExtraRoomsText ) { setShowRemember(false) if (codeError) { @@ -65,7 +65,7 @@ export default function BookingCode() { } } }, - [setShowRemember, setValue, intl, ref, codeError] + [setShowRemember, setValue, removeExtraRoomsText, ref, codeError] ) function showRememberCheck() { @@ -262,7 +262,6 @@ export function RemoveExtraRooms({ ...props }: ButtonProps) { return (