Skip to content

Commit 4525194

Browse files
committed
refactor(aria/lisbox): remove defaulting of label using textContent
1 parent 1497bca commit 4525194

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/aria/listbox/option.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ export class Option<V> {
5656
/** A unique identifier for the option. */
5757
readonly id = input(inject(_IdGenerator).getId('ng-option-', true));
5858

59-
// TODO(wagnermaciel): See if we want to change how we handle this since textContent is not
60-
// reactive. See https://github.com/angular/components/pull/30495#discussion_r1961260216.
61-
/** The text used by the typeahead search. */
62-
protected readonly searchTerm = computed(() => this.label() ?? this.element.textContent);
63-
6459
/** The parent Listbox UIPattern. */
6560
private readonly _listboxPattern = computed(() => this._listbox._pattern);
6661

@@ -83,6 +78,6 @@ export class Option<V> {
8378
value: this.value,
8479
listbox: this._listboxPattern,
8580
element: () => this.element,
86-
searchTerm: () => this.searchTerm() ?? '',
81+
searchTerm: () => this.label() ?? '',
8782
});
8883
}

0 commit comments

Comments
 (0)