diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/index.tsx index 0aaba54b0..d4c81a49f 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/RoomOne/index.tsx @@ -155,7 +155,7 @@ export default function Details({ user }: DetailsProps) { })} maxLength={30} name="firstName" - disabled={!!user} + readOnly={!!user} registerOptions={{ required: true, onBlur: updateDetailsStore }} /> (function Input( aria-label={ariaLabel} className={className} isDisabled={field.disabled} + isReadOnly={readOnly} isInvalid={fieldState.invalid} isRequired={!!registerOptions.required} name={field.name} diff --git a/packages/design-system/lib/components/Input/input.module.css b/packages/design-system/lib/components/Input/input.module.css index b8a0712b0..ccb67c3b6 100644 --- a/packages/design-system/lib/components/Input/input.module.css +++ b/packages/design-system/lib/components/Input/input.module.css @@ -13,12 +13,14 @@ box-sizing: border-box; cursor: text; - &:has(.input:focus) { + .container:has(.input:focus):not(:has(.input:disabled)), + .container:has(.input:focus):not(:has(.input:read-only)) { outline-offset: -2px; outline: 2px solid var(--Border-Interactive-Focus); } - &:has(.input:disabled) { + &:has(.input:disabled), + &:has(.input:read-only) { background-color: var(--Surface-Primary-Disabled); border: transparent; cursor: unset; @@ -50,8 +52,10 @@ outline: none; } - &:disabled { + &:disabled, + &:read-only { color: var(--Text-Interactive-Disabled); + cursor: unset; } } diff --git a/packages/design-system/lib/components/Label/label.module.css b/packages/design-system/lib/components/Label/label.module.css index c4d25db61..d246b3fc2 100644 --- a/packages/design-system/lib/components/Label/label.module.css +++ b/packages/design-system/lib/components/Label/label.module.css @@ -62,6 +62,7 @@ textarea[value]:not([value='']) ~ .label, } .label.disabled, +input:read-only ~ .label, input:disabled ~ .label, textarea:disabled ~ .label { color: var(--Text-Interactive-Disabled);