From 0829b8983dc6ae4d2cc5b8f7cf37729a1ac4b933 Mon Sep 17 00:00:00 2001 From: Andrey Dolgachev Date: Mon, 3 Nov 2025 17:31:50 -0800 Subject: [PATCH] refactor(multiple): Use simple function call for generated ids in angular/aria --- src/aria/listbox/listbox.ts | 6 ++---- src/aria/tree/tree.ts | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/aria/listbox/listbox.ts b/src/aria/listbox/listbox.ts index 7cb36191f4a2..395921e26d0f 100644 --- a/src/aria/listbox/listbox.ts +++ b/src/aria/listbox/listbox.ts @@ -62,9 +62,8 @@ export class Listbox { /** A unique identifier for the listbox. */ private readonly _generatedId = inject(_IdGenerator).getId('ng-listbox-', true); - // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144. /** A unique identifier for the listbox. */ - protected id = computed(() => this._generatedId); + protected id = () => this._generatedId; /** A reference to the parent combobox popup, if one exists. */ private readonly _popup = inject>(ComboboxPopup, { @@ -218,9 +217,8 @@ export class Option { /** A unique identifier for the option. */ private readonly _generatedId = inject(_IdGenerator).getId('ng-option-', true); - // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144. /** A unique identifier for the option. */ - protected id = computed(() => this._generatedId); + protected id = () => this._generatedId; // TODO(wagnermaciel): See if we want to change how we handle this since textContent is not // reactive. See https://github.com/angular/components/pull/30495#discussion_r1961260216. diff --git a/src/aria/tree/tree.ts b/src/aria/tree/tree.ts index a6dfa8445999..3ef200f3ddb9 100644 --- a/src/aria/tree/tree.ts +++ b/src/aria/tree/tree.ts @@ -89,9 +89,8 @@ export class Tree { /** A unique identifier for the tree. */ private readonly _generatedId = inject(_IdGenerator).getId('ng-tree-', true); - // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144. /** A unique identifier for the tree. */ - protected id = computed(() => this._generatedId); + protected id = () => this._generatedId; /** A reference to the parent combobox popup, if one exists. */ private readonly _popup = inject>(ComboboxPopup, {