diff --git a/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.service.ts b/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.service.ts index a2a0ffc66..188525216 100644 --- a/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.service.ts +++ b/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.service.ts @@ -21,6 +21,11 @@ export function setActionsIconOnlyProp( ): void { actionSets .flat() - .filter(action => action !== null && !action.hasAttribute('icon-only')) + .filter( + action => + action !== null && + action !== undefined && + !action?.hasAttribute('icon-only') + ) .forEach(action => (action.iconOnly = iconOnly)); } diff --git a/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.tsx b/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.tsx index 304f2aec7..bff3e460e 100644 --- a/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.tsx +++ b/packages/genesys-spark-components/src/components/stable/gux-table-toolbar/gux-table-toolbar.tsx @@ -98,7 +98,7 @@ export class GuxTableToolbar { return this.root?.querySelector('gux-table-toolbar-custom-action[slot]'); } - get permanentActions(): HTMLGuxTableToolbarCustomActionElement[] | null { + get permanentActions(): HTMLGuxTableToolbarCustomActionElement[] { if (this.permanentSlot?.hasChildNodes) { return Array.from( this.permanentSlot?.querySelectorAll( @@ -106,6 +106,7 @@ export class GuxTableToolbar { ) ); } + return []; } get menuActionsItems(): HTMLGuxTableToolbarCustomActionElement[] | null { @@ -118,7 +119,7 @@ export class GuxTableToolbar { } } - get contextualActions(): HTMLGuxTableToolbarCustomActionElement[] | null { + get contextualActions(): HTMLGuxTableToolbarCustomActionElement[] { if (this.contextualSlot?.hasChildNodes) { return Array.from( this.contextualSlot?.querySelectorAll( @@ -126,9 +127,10 @@ export class GuxTableToolbar { ) ); } + return []; } - get filterActions(): HTMLGuxTableToolbarCustomActionElement[] | null { + get filterActions(): HTMLGuxTableToolbarCustomActionElement[] { if (this.filterSlot?.hasChildNodes) { return Array.from( this.filterSlot?.querySelectorAll( @@ -136,9 +138,10 @@ export class GuxTableToolbar { ) ); } + return []; } - get allFilterContextual(): HTMLGuxTableToolbarCustomActionElement[] | null { + get allFilterContextual(): HTMLGuxTableToolbarCustomActionElement[] { return this.filterActions?.concat(this.contextualActions); }