You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only way to specify the readonly attribute for 'Text input' is to add input-readonly="readonly". On 'Textarea' it's textarea-readonly="readonly". On 'Date input' you can add the tag helpers for the individual fields and add readonly="readonly".
In Razor there isn't a way to choose whether to render input-readonly or textarea-readonly dynamically - you have to have two versions of the <govuk-input /> or <govuk-textarea /> tag with and without the attribute, and repeat any logic required to build up child tags.
The implementation of the disabled attribute is better - you can specify a boolean value and have the attribute render or not render. It would be useful if there was a similar readonly=bool attribute across these components. The readonly attribute does not apply to other components.