@@ -33,7 +33,7 @@ function Divider({modifiers, left}: DividerProps) {
3333 ) ;
3434}
3535
36- function getDividers ( lines : string , hasLeafs : boolean ) {
36+ function getDividers ( lines : string , hasVisibleSubNodes : boolean ) {
3737 const linesArray = lines . split ( '.' ) . map ( Number ) ;
3838 const dividers = [ ] ;
3939 for ( let i = 0 ; i < linesArray . length ; i ++ ) {
@@ -61,7 +61,7 @@ function getDividers(lines: string, hasLeafs: boolean) {
6161 ) ;
6262 }
6363 }
64- if ( i === linesArray . length - 1 && hasLeafs ) {
64+ if ( i === linesArray . length - 1 && hasVisibleSubNodes ) {
6565 //starting vertical line if node has leafs
6666 dividers . push (
6767 < Divider
@@ -82,9 +82,12 @@ function getDividers(lines: string, hasLeafs: boolean) {
8282export function OperationCell < TData > ( { row, depth = 0 , params} : OperationCellProps < TData > ) {
8383 const { name, operationParams, lines = '' } = params ;
8484
85- const hasLeafs = row . getLeafRows ( ) . length > 0 ;
85+ const hasVisibleSubNodes = row . getLeafRows ( ) . length > 0 && row . getIsExpanded ( ) ;
8686
87- const dividers = React . useMemo ( ( ) => getDividers ( lines , hasLeafs ) , [ lines , hasLeafs ] ) ;
87+ const dividers = React . useMemo (
88+ ( ) => getDividers ( lines , hasVisibleSubNodes ) ,
89+ [ lines , hasVisibleSubNodes ] ,
90+ ) ;
8891
8992 return (
9093 < div
0 commit comments