@@ -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
@@ -7800,9 +7800,18 @@ export abstract class IgxGridBaseDirective implements GridType,
78007800 this . disableTransitions = false ;
78017801
78027802 this . hideOverlays ( ) ;
7803- this . actionStrip ?. hide ( ) ;
7804- if ( this . actionStrip ) {
7805- this . actionStrip . context = null ;
7803+ const context = this . actionStrip ?. context ;
7804+ const contextEl = context ?. element ?. nativeElement as HTMLElement ;
7805+ const keepActionStrip =
7806+ ! ! context ?. pinned &&
7807+ ! ! contextEl ?. isConnected &&
7808+ ! this . hasMenuPinningActions ( ) ;
7809+
7810+ if ( ! keepActionStrip ) {
7811+ if ( this . actionStrip ) {
7812+ this . actionStrip . hide ( ) ;
7813+ this . actionStrip . context = null ;
7814+ }
78067815 }
78077816 const args : IGridScrollEventArgs = {
78087817 direction : 'vertical' ,
@@ -7812,6 +7821,23 @@ export abstract class IgxGridBaseDirective implements GridType,
78127821 this . gridScroll . emit ( args ) ;
78137822 }
78147823
7824+ protected hasMenuPinningActions ( ) : boolean {
7825+ const strip = this . actionStrip ;
7826+ const actionButtons = strip ?. actionButtons ;
7827+
7828+ if ( ! actionButtons ?. length ) {
7829+ return false ;
7830+ }
7831+
7832+ return actionButtons
7833+ . toArray ( )
7834+ . some (
7835+ ( button ) =>
7836+ button instanceof IgxGridPinningActionsComponent &&
7837+ button . asMenuItems
7838+ ) ;
7839+ }
7840+
78157841 protected horizontalScrollHandler ( event ) {
78167842 const scrollLeft = event . target . scrollLeft ;
78177843 this . headerContainer . onHScroll ( scrollLeft ) ;
0 commit comments