@@ -1381,21 +1381,26 @@ export abstract class AbstractGanttOutputComponent<
13811381 }
13821382
13831383 const stateStyle = outputStyle as OutputElementStyle ;
1384- const elementStyle = styles [ stateStyle . parentKey ] ;
1385- if ( elementStyle ) {
1386- return {
1387- color : parseInt ( elementStyle . color , 16 ) ,
1388- height : this . props . style . rowHeight * elementStyle . height ,
1389- borderWidth : state . selected ? 2 : 0 ,
1390- borderColor : 0xeef20c
1391- } ;
1384+ let parentKey = 'no-parent' ;
1385+ if ( stateStyle . parentKey ) {
1386+ parentKey = stateStyle . parentKey ;
1387+ const elementStyle = styles [ parentKey ] ;
1388+ if ( elementStyle ) {
1389+ return {
1390+ color : parseInt ( elementStyle . color , 16 ) ,
1391+ height : this . props . style . rowHeight * elementStyle . height ,
1392+ borderWidth : state . selected ? 2 : 0 ,
1393+ borderColor : 0xeef20c
1394+ } ;
1395+ }
1396+ style = this . styleMap . get ( parentKey ) ;
13921397 }
13931398
1394- style = this . styleMap . get ( stateStyle . parentKey ) ;
13951399 if ( style === undefined ) {
1396- style = backupStyles [ ( Math . abs ( hash ( stateStyle . parentKey ) ) as number ) % backupStyles . length ] ;
1397- this . styleMap . set ( stateStyle . parentKey , style ) ;
1400+ style = backupStyles [ Math . abs ( hash ( parentKey ) ) % backupStyles . length ] ;
1401+ this . styleMap . set ( parentKey , style ) ;
13981402 }
1403+
13991404 return {
14001405 color : style . color ,
14011406 height : style . height ,
0 commit comments