readonly input

This commit is contained in:
Mads Rasmussen
2024-08-19 21:45:31 +02:00
parent a2e5c0a344
commit 50d3d35a80

View File

@@ -21,6 +21,15 @@ export class UmbInputRadioButtonListElement extends UUIFormControlMixin(UmbLitEl
@property({ type: Array })
public list: Array<UmbRadioButtonItem> = [];
/**
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
* @type {boolean}
* @attr
* @default false
*/
@property({ type: Boolean, reflect: true })
readonly = false;
protected override getFormElement() {
return undefined;
}
@@ -36,7 +45,7 @@ export class UmbInputRadioButtonListElement extends UUIFormControlMixin(UmbLitEl
if (!this.list) return nothing;
return html`
<uui-radio-group .value=${this.value} @change=${this.#onChange}>
<uui-radio-group .value=${this.value} @change=${this.#onChange} ?readonly=${this.readonly}>
${repeat(
this.list,
(item) => item,