@@ -108,7 +108,7 @@ import { IgxGridRowComponent } from './grid-row.component';
108108import { IgxGridGroupByAreaComponent } from './grouping/grid-group-by-area.component' ;
109109import { IgxPaginatorToken , type IgxPaginatorComponent } from 'igniteui-angular/paginator' ;
110110import { IgxSnackbarComponent } from 'igniteui-angular/snackbar' ;
111- import { CharSeparatedValueData , DropPosition , FilterMode , getUUID , GridCellMergeMode , GridKeydownTargetType , GridPagingMode , GridSelectionMode , GridSelectionRange , GridServiceType , GridSummaryPosition , GridType , GridValidationTrigger , IActiveNode , IActiveNodeChangeEventArgs , ICellPosition , IClipboardOptions , IColumnMovingEndEventArgs , IColumnMovingEventArgs , IColumnMovingStartEventArgs , IColumnResizeEventArgs , IColumnsAutoGeneratedEventArgs , IColumnSelectionEventArgs , IColumnVisibilityChangedEventArgs , IColumnVisibilityChangingEventArgs , IFilteringEventArgs , IGridCellEventArgs , IGridClipboardEvent , IGridContextMenuEventArgs , IGridEditDoneEventArgs , IGridEditEventArgs , IGridFormGroupCreatedEventArgs , IGridKeydownEventArgs , IGridRowEventArgs , IGridScrollEventArgs , IGridToolbarExportEventArgs , IGridValidationStatusEventArgs , IGX_GRID_SERVICE_BASE , IgxAdvancedFilteringDialogComponent , IgxCell , IgxColumnComponent , IgxColumnGroupComponent , IgxColumnResizingService , IgxDragIndicatorIconDirective , IgxEditRow , IgxExcelStyleHeaderIconDirective , IgxExcelStyleLoadingValuesTemplateDirective , IgxFilteringService , IgxGridBodyDirective , IgxGridCellComponent , IgxGridColumnResizerComponent , IgxGridEmptyTemplateContext , IgxGridEmptyTemplateDirective , IgxGridExcelStyleFilteringComponent , IgxGridFilteringCellComponent , IgxGridFilteringRowComponent , IgxGridHeaderComponent , IgxGridHeaderGroupComponent , IgxGridHeaderRowComponent , IgxGridHeaderTemplateContext , IgxGridLoadingTemplateDirective , IgxGridNavigationService , IgxGridRowDragGhostContext , IgxGridRowEditActionsTemplateContext , IgxGridRowEditTemplateContext , IgxGridRowEditTextTemplateContext , IgxGridRowTemplateContext , IgxGridSelectionService , IgxGridSummaryService , IgxGridTemplateContext , IgxGridToolbarComponent , IgxGridTransaction , IgxGridValidationService , IgxHeaderCollapsedIndicatorDirective , IgxHeaderExpandedIndicatorDirective , IgxHeadSelectorDirective , IgxHeadSelectorTemplateContext , IgxRowAddTextDirective , IgxRowCollapsedIndicatorDirective , IgxRowDirective , IgxRowDragGhostDirective , IgxRowEditActionsDirective , IgxRowEditTabStopDirective , IgxRowEditTemplateDirective , IgxRowEditTextDirective , IgxRowExpandedIndicatorDirective , IgxRowSelectorDirective , IgxRowSelectorTemplateContext , IgxSortAscendingHeaderIconDirective , IgxSortDescendingHeaderIconDirective , IgxSortHeaderIconDirective , IgxSummaryRowComponent , IgxToolbarToken , IPinColumnCancellableEventArgs , IPinColumnEventArgs , IPinningConfig , IPinRowEventArgs , IRowDataCancelableEventArgs , IRowDataEventArgs , IRowDragEndEventArgs , IRowDragStartEventArgs , IRowSelectionEventArgs , IRowToggleEventArgs , ISearchInfo , ISizeInfo , ISortingEventArgs , RowEditPositionStrategy , RowPinningPosition , RowType , WatchChanges } from 'igniteui-angular/grids/core' ;
111+ import { CharSeparatedValueData , DropPosition , FilterMode , getUUID , GridCellMergeMode , GridKeydownTargetType , GridPagingMode , GridSelectionMode , GridSelectionRange , GridServiceType , GridSummaryPosition , GridType , GridValidationTrigger , IActiveNode , IActiveNodeChangeEventArgs , ICellPosition , IClipboardOptions , IColumnMovingEndEventArgs , IColumnMovingEventArgs , IColumnMovingStartEventArgs , IColumnResizeEventArgs , IColumnsAutoGeneratedEventArgs , IColumnSelectionEventArgs , IColumnVisibilityChangedEventArgs , IColumnVisibilityChangingEventArgs , IFilteringEventArgs , IGridCellEventArgs , IGridClipboardEvent , IGridContextMenuEventArgs , IGridEditDoneEventArgs , IGridEditEventArgs , IGridFormGroupCreatedEventArgs , IGridKeydownEventArgs , IGridRowEventArgs , IGridScrollEventArgs , IGridToolbarExportEventArgs , IGridValidationStatusEventArgs , IGX_GRID_SERVICE_BASE , IgxAdvancedFilteringDialogComponent , IgxCell , IgxColumnComponent , IgxColumnGroupComponent , IgxColumnResizingService , IgxDragIndicatorIconDirective , IgxEditRow , IgxExcelStyleHeaderIconDirective , IgxExcelStyleLoadingValuesTemplateDirective , IgxFilteringService , IgxGridBodyDirective , IgxGridCellComponent , IgxGridColumnResizerComponent , IgxGridEmptyTemplateContext , IgxGridEmptyTemplateDirective , IgxGridExcelStyleFilteringComponent , IgxGridFilteringCellComponent , IgxGridFilteringRowComponent , IgxGridHeaderComponent , IgxGridHeaderGroupComponent , IgxGridHeaderRowComponent , IgxGridHeaderTemplateContext , IgxGridLoadingTemplateDirective , IgxGridNavigationService , IgxGridPinningActionsComponent , IgxGridRowDragGhostContext , IgxGridRowEditActionsTemplateContext , IgxGridRowEditTemplateContext , IgxGridRowEditTextTemplateContext , IgxGridRowTemplateContext , IgxGridSelectionService , IgxGridSummaryService , IgxGridTemplateContext , IgxGridToolbarComponent , IgxGridTransaction , IgxGridValidationService , IgxHeaderCollapsedIndicatorDirective , IgxHeaderExpandedIndicatorDirective , IgxHeadSelectorDirective , IgxHeadSelectorTemplateContext , IgxRowAddTextDirective , IgxRowCollapsedIndicatorDirective , IgxRowDirective , IgxRowDragGhostDirective , IgxRowEditActionsDirective , IgxRowEditTabStopDirective , IgxRowEditTemplateDirective , IgxRowEditTextDirective , IgxRowExpandedIndicatorDirective , IgxRowSelectorDirective , IgxRowSelectorTemplateContext , IgxSortAscendingHeaderIconDirective , IgxSortDescendingHeaderIconDirective , IgxSortHeaderIconDirective , IgxSummaryRowComponent , IgxToolbarToken , IPinColumnCancellableEventArgs , IPinColumnEventArgs , IPinningConfig , IPinRowEventArgs , IRowDataCancelableEventArgs , IRowDataEventArgs , IRowDragEndEventArgs , IRowDragStartEventArgs , IRowSelectionEventArgs , IRowToggleEventArgs , ISearchInfo , ISizeInfo , ISortingEventArgs , RowEditPositionStrategy , RowPinningPosition , RowType , WatchChanges } from 'igniteui-angular/grids/core' ;
112112import { getCurrentI18n , getNumberFormatter , IResourceChangeEventArgs , } from 'igniteui-i18n-core' ;
113113import { I18N_FORMATTER } from 'igniteui-angular/core' ;
114114
@@ -3666,7 +3666,7 @@ export abstract class IgxGridBaseDirective implements GridType,
36663666
36673667 protected getMergeCellOffset ( rowData ) {
36683668 const index = rowData . dataIndex ;
3669- let offset = this . verticalScrollContainer . scrollPosition - this . verticalScrollContainer . getScrollForIndex ( index ) ;
3669+ let offset = this . verticalScrollContainer . _virtScrollPosition - this . verticalScrollContainer . getScrollForIndex ( index ) ;
36703670 if ( this . hasPinnedRecords && this . isRowPinningToTop ) {
36713671 offset -= this . pinnedRowHeight ;
36723672 }
@@ -4071,6 +4071,13 @@ export abstract class IgxGridBaseDirective implements GridType,
40714071 this . paginationComponents . changes . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
40724072 this . setUpPaginator ( ) ;
40734073 } ) ;
4074+
4075+ this . actionStripComponents . changes . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
4076+ if ( this . actionStrip ) {
4077+ this . actionStrip . menuOverlaySettings . outlet = this . outlet ;
4078+ }
4079+ } ) ;
4080+
40744081 if ( this . actionStrip ) {
40754082 this . actionStrip . menuOverlaySettings . outlet = this . outlet ;
40764083 }
@@ -7809,9 +7816,18 @@ export abstract class IgxGridBaseDirective implements GridType,
78097816 this . disableTransitions = false ;
78107817
78117818 this . hideOverlays ( ) ;
7812- this . actionStrip ?. hide ( ) ;
7813- if ( this . actionStrip ) {
7814- this . actionStrip . context = null ;
7819+ const context = this . actionStrip ?. context ;
7820+ const contextEl = context ?. element ?. nativeElement as HTMLElement ;
7821+ const keepActionStrip =
7822+ ! ! context ?. pinned &&
7823+ ! ! contextEl ?. isConnected &&
7824+ ! this . hasMenuPinningActions ( ) ;
7825+
7826+ if ( ! keepActionStrip ) {
7827+ if ( this . actionStrip ) {
7828+ this . actionStrip . hide ( ) ;
7829+ this . actionStrip . context = null ;
7830+ }
78157831 }
78167832 const args : IGridScrollEventArgs = {
78177833 direction : 'vertical' ,
@@ -7821,6 +7837,23 @@ export abstract class IgxGridBaseDirective implements GridType,
78217837 this . gridScroll . emit ( args ) ;
78227838 }
78237839
7840+ protected hasMenuPinningActions ( ) : boolean {
7841+ const strip = this . actionStrip ;
7842+ const actionButtons = strip ?. actionButtons ;
7843+
7844+ if ( ! actionButtons ?. length ) {
7845+ return false ;
7846+ }
7847+
7848+ return actionButtons
7849+ . toArray ( )
7850+ . some (
7851+ ( button ) =>
7852+ button instanceof IgxGridPinningActionsComponent &&
7853+ button . asMenuItems
7854+ ) ;
7855+ }
7856+
78247857 protected horizontalScrollHandler ( event ) {
78257858 const scrollLeft = event . target . scrollLeft ;
78267859 this . headerContainer . onHScroll ( scrollLeft ) ;
@@ -8229,16 +8262,16 @@ export abstract class IgxGridBaseDirective implements GridType,
82298262 // recalc merged data
82308263 if ( this . columnsToMerge . length > 0 ) {
82318264 const startIndex = this . verticalScrollContainer . state . startIndex ;
8232- const prevDataView = this . verticalScrollContainer . igxForOf ?. slice ( 0 , startIndex ) ;
82338265 const data = [ ] ;
8234- for ( let index = 0 ; index < startIndex ; index ++ ) {
8235- const rec = prevDataView [ index ] ;
8236- if ( rec . cellMergeMeta &&
8237- // index + maxRowSpan is within view
8238- startIndex < ( index + Math . max ( ...rec . cellMergeMeta . values ( ) . toArray ( ) . map ( x => x . rowSpan ) ) ) ) {
8239- const visibleIndex = this . isRowPinningToTop ? index + this . pinnedRecordsCount : index ;
8240- data . push ( { record : rec , index : visibleIndex , dataIndex : index } ) ;
8241- }
8266+ const rec = this . verticalScrollContainer . igxForOf [ startIndex ] ;
8267+ if ( rec && rec . cellMergeMeta ) {
8268+ this . columnsToMerge . forEach ( ( col ) => {
8269+ const root = rec . cellMergeMeta ?. get ( col . field ) ?. root ;
8270+ if ( root ) {
8271+ data . push ( { record : root , index : root . index , dataIndex : root . index } ) ;
8272+ }
8273+ } )
8274+
82428275 }
82438276 this . _mergedDataInView = data ;
82448277 this . notifyChanges ( ) ;
0 commit comments