File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
packages/uui-boolean-input/lib Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,15 @@ export abstract class UUIBooleanInputElement extends UUIFormControlMixin(
85
85
@property ( { type : Boolean , reflect : true } )
86
86
disabled = false ;
87
87
88
+ /**
89
+ * Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
90
+ * @type {boolean }
91
+ * @attr
92
+ * @default false
93
+ */
94
+ @property ( { type : Boolean , reflect : true } )
95
+ readonly = false ;
96
+
88
97
@query ( '#input' )
89
98
protected _input ! : HTMLInputElement ;
90
99
@@ -176,7 +185,7 @@ export abstract class UUIBooleanInputElement extends UUIFormControlMixin(
176
185
id= "input"
177
186
type = "checkbox"
178
187
@change = "${ this . _onInputChange } "
179
- .disabled = ${ this . disabled }
188
+ .disabled = ${ this . disabled || this . readonly }
180
189
.checked = ${ this . checked }
181
190
aria- checked= "${ this . checked ? 'true' : 'false' } "
182
191
aria-label = ${ this . label }
@@ -196,14 +205,18 @@ export abstract class UUIBooleanInputElement extends UUIFormControlMixin(
196
205
position : relative;
197
206
cursor : pointer;
198
207
user-select : none;
199
-
200
208
display : flex;
201
209
flex-wrap : nowrap;
202
210
align-items : center;
203
211
justify-items : center;
204
212
gap : var (--uui-size-3 );
205
213
}
206
214
215
+ : host ([readonly ]) label {
216
+ cursor : text;
217
+ user-select : auto;
218
+ }
219
+
207
220
input {
208
221
position : absolute;
209
222
height : 0px ;
You can’t perform that action at this time.
0 commit comments