@@ -28,11 +28,11 @@ import { View } from '@instructure/ui-view'
2828import {
2929 safeCloneElement ,
3030 callRenderProp ,
31- omitProps
31+ omitProps ,
32+ withDeterministicId
3233} from '@instructure/ui-react-utils'
3334import { createChainedFunction } from '@instructure/ui-utils'
3435import { logError as error } from '@instructure/console'
35- import { uid } from '@instructure/uid'
3636import { AccessibleContent } from '@instructure/ui-a11y-content'
3737
3838import { testable } from '@instructure/ui-testable'
@@ -64,6 +64,7 @@ import { SimpleSelect } from '@instructure/ui-simple-select'
6464category: components
6565---
6666**/
67+ @withDeterministicId ( )
6768@withStyle ( generateStyle , generateComponentTheme )
6869@testable ( )
6970class Calendar extends Component < CalendarProps , CalendarState > {
@@ -82,14 +83,15 @@ class Calendar extends Component<CalendarProps, CalendarState> {
8283 }
8384
8485 ref : Element | null = null
85- private _weekdayHeaderIds = (
86- this . props . renderWeekdayLabels || this . defaultWeekdays
87- ) . reduce ( ( ids : Record < number , string > , _label , i ) => {
88- return { ...ids , [ i ] : uid ( `weekday-header-${ i } ` ) }
89- } , { } )
86+ private _weekdayHeaderIds
87+
9088 constructor ( props : CalendarProps ) {
9189 super ( props )
92-
90+ this . _weekdayHeaderIds = (
91+ this . props . renderWeekdayLabels || this . defaultWeekdays
92+ ) . reduce ( ( ids : Record < number , string > , _label , i ) => {
93+ return { ...ids , [ i ] : this . props . deterministicId ! ( 'weekday-header' ) }
94+ } , { } )
9395 this . state = this . calculateState (
9496 this . locale ( ) ,
9597 this . timezone ( ) ,
0 commit comments