@@ -44,7 +44,7 @@ import {Overlay, OverlayRef} from '@angular/cdk/overlay';
44
44
import { TemplatePortal } from '@angular/cdk/portal' ;
45
45
import { _getEventTarget } from '@angular/cdk/platform' ;
46
46
import { ENTER , ESCAPE , hasModifierKey , TAB } from '@angular/cdk/keycodes' ;
47
- import { ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
47
+ import { _IdGenerator , ActiveDescendantKeyManager } from '@angular/cdk/a11y' ;
48
48
import type { MatTimepickerInput } from './timepicker-input' ;
49
49
import {
50
50
generateOptions ,
@@ -55,9 +55,6 @@ import {
55
55
} from './util' ;
56
56
import { Subscription } from 'rxjs' ;
57
57
58
- /** Counter used to generate unique IDs. */
59
- let uniqueId = 0 ;
60
-
61
58
/** Event emitted when a value is selected in the timepicker. */
62
59
export interface MatTimepickerSelected < D > {
63
60
value : D ;
@@ -157,7 +154,7 @@ export class MatTimepicker<D> implements OnDestroy, MatOptionParentComponent {
157
154
readonly activeDescendant : Signal < string | null > = this . _activeDescendant . asReadonly ( ) ;
158
155
159
156
/** Unique ID of the timepicker's panel */
160
- readonly panelId = ` mat-timepicker-panel-${ uniqueId ++ } ` ;
157
+ readonly panelId : string = inject ( _IdGenerator ) . getId ( ' mat-timepicker-panel-' ) ;
161
158
162
159
/** Whether ripples within the timepicker should be disabled. */
163
160
readonly disableRipple : InputSignalWithTransform < boolean , unknown > = input (
0 commit comments