File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
packages/uui-combobox/lib Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,17 @@ export class UUIComboboxElement extends FormControlMixin(LitElement) {
76
76
` ,
77
77
] ;
78
78
79
+ get value ( ) {
80
+ return this . _value ;
81
+ }
82
+ set value ( newValue ) {
83
+ super . value = newValue ;
84
+
85
+ if ( typeof newValue === 'string' ) {
86
+ this . _updateValue ( newValue ) ;
87
+ }
88
+ }
89
+
79
90
/**
80
91
* The search input.
81
92
* @type { string }
@@ -151,12 +162,18 @@ export class UUIComboboxElement extends FormControlMixin(LitElement) {
151
162
152
163
if ( typeof this . value === 'string' ) {
153
164
await this . updateComplete ;
154
- this . _comboboxList . value = this . value ;
155
- this . _displayValue = this . _comboboxList ?. displayValue || '' ;
165
+ this . _updateValue ( this . value ) ;
156
166
}
157
167
}
158
168
}
159
169
170
+ private _updateValue ( value : string ) {
171
+ if ( this . _comboboxList ) {
172
+ this . _comboboxList . value = value ;
173
+ this . _displayValue = this . _comboboxList ?. displayValue || '' ;
174
+ }
175
+ }
176
+
160
177
protected getFormElement ( ) : HTMLElement | undefined {
161
178
return this . _input ;
162
179
}
You can’t perform that action at this time.
0 commit comments