diff --git a/packages/main/src/components/SelectDialog/SelectDialog.cy.tsx b/packages/main/src/components/SelectDialog/SelectDialog.cy.tsx index 5d6d64377b3..0a14e192870 100644 --- a/packages/main/src/components/SelectDialog/SelectDialog.cy.tsx +++ b/packages/main/src/components/SelectDialog/SelectDialog.cy.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import type { ListPropTypes, SelectDialogPropTypes } from '../..'; -import { Button, ListMode, SelectDialog, StandardListItem } from '../..'; +import { Button, ButtonDesign, ListMode, SelectDialog, StandardListItem } from '../..'; const listItems = new Array(5).fill('o_O').map((_, index) => ( @@ -274,4 +274,17 @@ describe('SelectDialog', () => { callCount++; }); }); + + it('confirmButtonProps', () => { + cy.mount( + + ); + cy.findByTestId('confirmBtn').should('be.visible').and('have.attr', 'disabled'); + cy.findByTestId('confirmBtn').should('have.attr', 'design', 'Emphasized'); + }); }); diff --git a/packages/main/src/components/SelectDialog/index.tsx b/packages/main/src/components/SelectDialog/index.tsx index c6595a31608..9f1def93368 100644 --- a/packages/main/src/components/SelectDialog/index.tsx +++ b/packages/main/src/components/SelectDialog/index.tsx @@ -136,6 +136,10 @@ export interface SelectDialogPropTypes * __Note:__ This won't work if the dialog is unmounted, if you want to unmount the dialog when closed, you need to persist the selection yourself. */ rememberSelections?: boolean; + /** + * Defines the number of selected list items displayed above the list in `MultiSelect` mode. Programmatically setting the counter is necessary if all previously selected elements are to remain selected during search. + */ + numberOfSelectedItems?: number; /** * Defines the mode of the SelectDialog list. * @@ -153,9 +157,13 @@ export interface SelectDialogPropTypes */ listProps?: Omit; /** - * Defines the number of selected list items displayed above the list in `MultiSelect` mode. Programmatically setting the counter is necessary if all previously selected elements are to remain selected during search. + * Defines the props of the confirm button. + * + * __Note:__`onClick` and `design` are not supported. + * + * @since 1.25.0 */ - numberOfSelectedItems?: number; + confirmButtonProps?: Omit; /** * This event will be fired when the value of the search field is changed by a user - e.g. at each key press */ @@ -194,6 +202,7 @@ const SelectDialog = forwardRef((props, ref children, className, confirmButtonText, + confirmButtonProps, growing, headerText, headerTextAlignCenter, @@ -399,7 +408,7 @@ const SelectDialog = forwardRef((props, ref
{mode === ListMode.MultiSelect && ( - )}