Skip to content

Commit 898e5bd

Browse files
committed
refactor(aria/lisbox): remove defaulting of label using textContent
1 parent 6b6d5a3 commit 898e5bd

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

goldens/aria/listbox/index.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class Option_2<V> {
4242
readonly id: _angular_core.InputSignal<string>;
4343
readonly label: _angular_core.InputSignal<string | undefined>;
4444
readonly _pattern: OptionPattern<V>;
45-
protected readonly searchTerm: _angular_core.Signal<string>;
4645
readonly selected: _angular_core.Signal<boolean | undefined>;
4746
readonly value: _angular_core.InputSignal<V>;
4847
// (undocumented)

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)