Skip to content

Commit 2f21ba2

Browse files
committed
Refactor combobox mode
1 parent 63781b6 commit 2f21ba2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/includes/vscode-select/OptionListController.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export class OptionListController implements ReactiveController {
4343
return this._options[this._activeIndex]?.relativeIndex ?? -1;
4444
}
4545

46+
set comboboxMode(enabled: boolean) {
47+
this._combobox = enabled;
48+
this._host.requestUpdate();
49+
}
50+
4651
get comboboxMode() {
4752
return this._combobox;
4853
}
@@ -267,11 +272,6 @@ export class OptionListController implements ReactiveController {
267272
this._host.requestUpdate();
268273
}
269274

270-
toggleComboboxMode(enabled: boolean) {
271-
this._combobox = enabled;
272-
this._host.requestUpdate();
273-
}
274-
275275
toggleActiveMultiselectOption() {
276276
const activeOption = this._options[this._activeIndex] ?? null;
277277
const checked = this._selectedIndexes.has(activeOption.index);

src/includes/vscode-select/vscode-select-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class VscodeSelectBase extends VscElement {
3232
*/
3333
@property({type: Boolean, reflect: true})
3434
set combobox(enabled: boolean) {
35-
this._opts.toggleComboboxMode(enabled);
35+
this._opts.comboboxMode = enabled;
3636
}
3737
get combobox() {
3838
return this._opts.comboboxMode;

0 commit comments

Comments
 (0)