Skip to content

Commit eed79d6

Browse files
ok7saicrisbeto
andauthored
refactor(multiple): expose APIs necessary for demos (#32262)
Exposes some APIs used in the demos instead of accessing the private `_pattern`. (cherry picked from commit f0e411b) Co-authored-by: Kristiyan Kostadinov <crisbeto@abv.bg>
1 parent 4b5db13 commit eed79d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components-examples/aria/combobox/combobox-readonly/combobox-readonly-example.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,17 @@ export class ComboboxReadonlyExample {
5151
afterRenderEffect(() => {
5252
const popover = this.popover()!;
5353
const combobox = this.combobox()!;
54-
combobox._pattern.expanded() ? this.showPopover() : popover.nativeElement.hidePopover();
54+
combobox.expanded() ? this.showPopover() : popover.nativeElement.hidePopover();
5555

56-
// TODO(wagnermaciel): Make this easier for developers to do.
57-
this.listbox()?._pattern.inputs.activeItem()?.element().scrollIntoView({block: 'nearest'});
56+
this.listbox()?.scrollActiveItemIntoView();
5857
});
5958
}
6059

6160
showPopover() {
6261
const popover = this.popover()!;
6362
const combobox = this.combobox()!;
6463

65-
const comboboxRect = combobox._pattern.inputs.inputEl()?.getBoundingClientRect();
64+
const comboboxRect = combobox.inputElement()?.getBoundingClientRect();
6665
const popoverEl = popover.nativeElement;
6766

6867
if (comboboxRect) {

0 commit comments

Comments
 (0)