diff --git a/pages/button-dropdown/permutations-main-action.page.tsx b/pages/button-dropdown/permutations-main-action.page.tsx index 820b503c54..ed55dfef83 100644 --- a/pages/button-dropdown/permutations-main-action.page.tsx +++ b/pages/button-dropdown/permutations-main-action.page.tsx @@ -32,6 +32,7 @@ const permutations = createPermutations([ { ...launchInstanceItem }, { ...launchInstanceItem, disabled: true }, { ...launchInstanceItem, loading: true, loadingText: 'Loading' }, + { iconName: 'add-plus', ariaLabel: 'Add resource' }, ], items: [ [ diff --git a/src/__tests__/__snapshots__/documenter.test.ts.snap b/src/__tests__/__snapshots__/documenter.test.ts.snap index e26683a271..2c6e1ac6a2 100644 --- a/src/__tests__/__snapshots__/documenter.test.ts.snap +++ b/src/__tests__/__snapshots__/documenter.test.ts.snap @@ -3737,7 +3737,7 @@ The main action also supports the following properties of the [button](/componen }, Object { "name": "text", - "optional": false, + "optional": true, "type": "string", }, ], diff --git a/src/button-dropdown/interfaces.ts b/src/button-dropdown/interfaces.ts index 788f47bee0..50469f5eab 100644 --- a/src/button-dropdown/interfaces.ts +++ b/src/button-dropdown/interfaces.ts @@ -121,7 +121,7 @@ export namespace ButtonDropdownProps { export type ItemType = 'action' | 'group'; export interface MainAction { - text: string; + text?: string; ariaLabel?: string; onClick?: CancelableEventHandler; onFollow?: CancelableEventHandler; diff --git a/src/button-dropdown/internal.tsx b/src/button-dropdown/internal.tsx index d2f38e28be..b0c620bbb4 100644 --- a/src/button-dropdown/internal.tsx +++ b/src/button-dropdown/internal.tsx @@ -210,7 +210,7 @@ const InternalButtonDropdown = React.forwardRef( const mainActionAriaLabel = externalIconAriaLabel ? `${mainAction.ariaLabel ?? mainAction.text} ${mainAction.externalIconAriaLabel}` : mainAction.ariaLabel; - + const hasNoText = !text; trigger = (