Skip to content

Commit def0c29

Browse files
committed
fix(grid): Simplify hasMenuPinningActions method for better readability
1 parent 6aecd3c commit def0c29

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

projects/igniteui-angular/grids/grid/src/grid-base.directive.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7828,18 +7828,19 @@ export abstract class IgxGridBaseDirective implements GridType,
78287828

78297829
protected hasMenuPinningActions(): boolean {
78307830
const strip = this.actionStrip;
7831-
if (!strip?.actionButtons?.length) {
7831+
const actionButtons = strip?.actionButtons;
7832+
7833+
if (!actionButtons?.length) {
78327834
return false;
78337835
}
78347836

7835-
let hasMenuPinningActions = false;
7836-
strip.actionButtons.forEach((button) => {
7837-
if (button instanceof IgxGridPinningActionsComponent && button.asMenuItems) {
7838-
hasMenuPinningActions = true;
7839-
}
7840-
});
7841-
7842-
return hasMenuPinningActions;
7837+
return actionButtons
7838+
.toArray()
7839+
.some(
7840+
(button) =>
7841+
button instanceof IgxGridPinningActionsComponent &&
7842+
button.asMenuItems
7843+
);
78437844
}
78447845

78457846
protected horizontalScrollHandler(event) {

0 commit comments

Comments
 (0)