@@ -44,7 +44,7 @@ import {Overlay, OverlayRef} from '@angular/cdk/overlay';
4444import { TemplatePortal } from '@angular/cdk/portal' ;
4545import { _getEventTarget } from '@angular/cdk/platform' ;
4646import { ENTER , ESCAPE , hasModifierKey , TAB } from '@angular/cdk/keycodes' ;
47- import { ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
47+ import { _IdGenerator , ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
4848import type { MatTimepickerInput } from './timepicker-input' ;
4949import {
5050 generateOptions ,
@@ -55,9 +55,6 @@ import {
5555} from './util' ;
5656import { Subscription } from 'rxjs' ;
5757
58- /** Counter used to generate unique IDs. */
59- let uniqueId = 0 ;
60-
6158/** Event emitted when a value is selected in the timepicker. */
6259export interface MatTimepickerSelected < D > {
6360 value : D ;
@@ -157,7 +154,7 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
157154 readonly activeDescendant : Signal < string | null > = this . _activeDescendant . asReadonly ( ) ;
158155
159156 /** Unique ID of the timepicker's panel */
160- readonly panelId = ` mat-timepicker-panel-${ uniqueId ++ } ` ;
157+ readonly panelId : string = inject ( _IdGenerator ) . getId ( ' mat-timepicker-panel-' ) ;
161158
162159 /** Whether ripples within the timepicker should be disabled. */
163160 readonly disableRipple : InputSignalWithTransform < boolean , unknown > = input (
0 commit comments