@@ -629,18 +629,8 @@ export class Datetime implements ComponentInterface {
629
629
return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date' ;
630
630
}
631
631
632
- /**
633
- * Stencil sometimes sets calendarBodyRef to null on rerender, even though
634
- * the element is present. Query for it manually as a fallback.
635
- *
636
- * TODO(FW-901) Remove when issue is resolved: https://github.com/ionic-team/stencil/issues/3253
637
- */
638
- private getCalendarBodyEl = ( ) => {
639
- return this . calendarBodyRef || this . el . shadowRoot ?. querySelector ( '.calendar-body' ) ;
640
- } ;
641
-
642
632
private initializeKeyboardListeners = ( ) => {
643
- const calendarBodyRef = this . getCalendarBodyEl ( ) ;
633
+ const calendarBodyRef = this . calendarBodyRef ;
644
634
if ( ! calendarBodyRef ) {
645
635
return ;
646
636
}
@@ -818,7 +808,7 @@ export class Datetime implements ComponentInterface {
818
808
} ;
819
809
820
810
private initializeCalendarListener = ( ) => {
821
- const calendarBodyRef = this . getCalendarBodyEl ( ) ;
811
+ const calendarBodyRef = this . calendarBodyRef ;
822
812
if ( ! calendarBodyRef ) {
823
813
return ;
824
814
}
@@ -1241,7 +1231,7 @@ export class Datetime implements ComponentInterface {
1241
1231
} ;
1242
1232
1243
1233
private nextMonth = ( ) => {
1244
- const calendarBodyRef = this . getCalendarBodyEl ( ) ;
1234
+ const calendarBodyRef = this . calendarBodyRef ;
1245
1235
if ( ! calendarBodyRef ) {
1246
1236
return ;
1247
1237
}
@@ -1261,7 +1251,7 @@ export class Datetime implements ComponentInterface {
1261
1251
} ;
1262
1252
1263
1253
private prevMonth = ( ) => {
1264
- const calendarBodyRef = this . getCalendarBodyEl ( ) ;
1254
+ const calendarBodyRef = this . calendarBodyRef ;
1265
1255
if ( ! calendarBodyRef ) {
1266
1256
return ;
1267
1257
}
@@ -1989,7 +1979,7 @@ export class Datetime implements ComponentInterface {
1989
1979
}
1990
1980
private renderCalendar ( mode : Mode ) {
1991
1981
return (
1992
- < div class = "datetime-calendar" >
1982
+ < div class = "datetime-calendar" key = "datetime-calendar" >
1993
1983
{ this . renderCalendarHeader ( mode ) }
1994
1984
{ this . renderCalendarBody ( ) }
1995
1985
</ div >
0 commit comments