File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
projects/igniteui-angular/src/lib/grids/grid Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -110,18 +110,24 @@ export class IgxGridUnmergeActivePipe implements PipeTransform {
110110 if ( this . grid . hasPinnedRecords && ! pinned && this . grid . pinning . rows !== RowPinningPosition . Bottom ) {
111111 activeRowIndexes = activeRowIndexes . map ( x => x - this . grid . pinnedRecordsCount ) ;
112112 }
113- const result = cloneArray ( collection ) as any ;
114113 activeRowIndexes = activeRowIndexes . filter ( ( val , idx , arr ) => arr . indexOf ( val ) === idx ) . filter ( x => ! isNaN ( x ) ) ;
115114 const rootsToUpdate = [ ] ;
116115 activeRowIndexes . forEach ( index => {
117116 const target = collection [ index ] ;
118117 colsToMerge . forEach ( col => {
119118 const colMeta = target . cellMergeMeta . get ( col . field ) ;
120- const root = colMeta . root || target ;
121- rootsToUpdate . push ( root ) ;
119+ const root = colMeta . root || ( colMeta . rowSpan > 1 ? target : null ) ;
120+ if ( root ) {
121+ rootsToUpdate . push ( root ) ;
122+ }
122123 } ) ;
123124 } ) ;
124125 const uniqueRoots = rootsToUpdate . filter ( ( val , idx , arr ) => arr . indexOf ( val ) === idx ) ;
126+ if ( uniqueRoots . length === 0 ) {
127+ // if nothing to update, return
128+ return collection ;
129+ }
130+ const result = cloneArray ( collection ) as any ;
125131 uniqueRoots . forEach ( x => {
126132 const index = result . indexOf ( x ) ;
127133 const colKeys = [ ...x . cellMergeMeta . keys ( ) ] ;
You can’t perform that action at this time.
0 commit comments