diff --git a/doc/formelements.md b/doc/formelements.md index 5504cd1..dba8d2f 100644 --- a/doc/formelements.md +++ b/doc/formelements.md @@ -152,7 +152,7 @@ They are required by default. Options: * `validation` _(optional)_ - used to apply [validation](validation.md) -* `readonly` _(optional)_ - Disables user input. Available only for fields where users type in values. Useful when values are pre-filled from `values.yaml` +* `readonly` _(optional)_ - Disables user input but keeps any pre-filled values intact. Fields where users type in values get an actual HTML attribute `readonly`. Select fields like dropdowns and radios, where this property is not allowed, are visually toned down and are non-interactive. Useful when values are pre-filled from `values.yaml` ```yaml : diff --git a/public/css/app.css b/public/css/app.css index d33ab2e..03cf007 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -302,12 +302,23 @@ div.label-smaller { } /** - * Readonly field looking more a like disabled one + * Readonly field looking more like disabled ones, + * simulate readonly look for inputs that have no HTML readonly attribute */ input[readonly] { cursor: not-allowed; } +select.readonly-select { + pointer-events:none; + background: var(--bulma-input-disabled-placeholder-color); +} + +.readonly-choices { + pointer-events:none; + opacity: 0.7; +} + /** ** Bulma overrides */ diff --git a/view/checklist.twig b/view/checklist.twig index eaa3966..5dadc0e 100644 --- a/view/checklist.twig +++ b/view/checklist.twig @@ -13,14 +13,14 @@
{%- for choice in choices -%} -