Skip to content

Commit 044e3fc

Browse files
committed
refactor(cdk-experimental/combobox): use ID generator
Switches to using the ID generator service to create unique IDs.
1 parent abbc5c1 commit 044e3fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cdk-experimental/combobox/combobox-popup.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
*/
88

99
import {Directive, ElementRef, Input, OnInit, inject} from '@angular/core';
10+
import {_IdGenerator} from '@angular/cdk/a11y';
1011
import {AriaHasPopupValue, CDK_COMBOBOX, CdkCombobox} from './combobox';
1112

12-
let nextId = 0;
13-
1413
@Directive({
1514
selector: '[cdkComboboxPopup]',
1615
exportAs: 'cdkComboboxPopup',
@@ -44,7 +43,7 @@ export class CdkComboboxPopup<T = unknown> implements OnInit {
4443
}
4544
private _firstFocusElement: HTMLElement;
4645

47-
@Input() id = `cdk-combobox-popup-${nextId++}`;
46+
@Input() id: string = inject(_IdGenerator).getId('cdk-combobox-popup-');
4847

4948
ngOnInit() {
5049
this.registerWithPanel();

0 commit comments

Comments
 (0)