Skip to content

Commit bff91ff

Browse files
committed
refactor(aria/combobox): Extend public api with open/close/select methods
1 parent e8300da commit bff91ff

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/aria/combobox/combobox.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ export class Combobox<V> {
113113
}
114114
});
115115
}
116+
117+
/** Opens the combobox. */
118+
open(nav?: {first?: boolean; last?: boolean; selected?: boolean}) {
119+
this._pattern.open(nav);
120+
}
121+
122+
/** Closes the combobox. */
123+
close(opts?: {reset: boolean}) {
124+
this._pattern.close(opts);
125+
}
126+
127+
/** Selects an item in the combobox popup. */
128+
select(opts: {item?: V; commit?: boolean; close?: boolean} = {}) {
129+
this._pattern.select(opts);
130+
}
116131
}
117132

118133
@Directive({

0 commit comments

Comments
 (0)