Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/aria/combobox/combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
contentChild,
Directive,
ElementRef,
forwardRef,
inject,
input,
model,
Expand Down Expand Up @@ -98,7 +99,12 @@ export class Combobox<V> {
private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});

/** The combobox popup. */
readonly popup = contentChild<ComboboxPopup<V>>(ComboboxPopup);
readonly popup = contentChild<ComboboxPopup<V>>(
// We need a `forwardRef` here, because the popup class is declared further down
// in the same file. When the reference is written to Angular's metadata this can
// cause an attempt to access the class before it's defined.
forwardRef(() => ComboboxPopup),
);

/**
* The filter mode for the combobox.
Expand Down
9 changes: 8 additions & 1 deletion src/aria/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
contentChildren,
Directive,
ElementRef,
forwardRef,
inject,
input,
model,
Expand Down Expand Up @@ -81,7 +82,13 @@ export class Listbox<V> {
private readonly _directionality = inject(Directionality);

/** The Options nested inside of the Listbox. */
private readonly _options = contentChildren(Option, {descendants: true});
private readonly _options = contentChildren(
// We need a `forwardRef` here, because the option class is declared further down
// in the same file. When the reference is written to Angular's metadata this can
// cause an attempt to access the class before it's defined.
forwardRef(() => Option),
{descendants: true},
);

/** A signal wrapper for directionality. */
protected textDirection = toSignal(this._directionality.change, {
Expand Down
Loading