Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit b77b284

Browse files
madsrasmussenleekelleher
authored andcommitted
add readonly prop
1 parent 784060b commit b77b284

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/packages/property-editors/toggle/property-editor-ui-toggle.element.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ export class UmbPropertyEditorUIToggleElement extends UmbLitElement implements U
1313
@property({ type: Boolean })
1414
value: undefined | boolean = undefined;
1515

16+
/**
17+
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
18+
* @type {boolean}
19+
* @attr
20+
* @default false
21+
*/
22+
@property({ type: Boolean, reflect: true })
23+
readonly = false;
24+
1625
@state()
1726
_labelOff?: string;
1827

@@ -42,7 +51,8 @@ export class UmbPropertyEditorUIToggleElement extends UmbLitElement implements U
4251
.labelOff=${this._labelOff}
4352
?checked=${this.value}
4453
?showLabels=${this._showLabels}
45-
@change=${this.#onChange}>
54+
@change=${this.#onChange}
55+
?readonly=${this.readonly}>
4656
</umb-input-toggle>
4757
`;
4858
}

0 commit comments

Comments
 (0)