Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "prerelease",
"area": "improvement",
"workstream": "CustomButtonInjection",
"comment": "Add custom button injection autohide in drawermenus",
"packageName": "@azure/communication-react",
"email": "edwardlee@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2901,6 +2901,7 @@ export type CustomCallControlButtonPlacement = 'primary' | 'overflow' | 'seconda
// @public
export interface CustomCallControlButtonProps {
disabled?: boolean;
dismissDrawer?: boolean;
iconName?: string;
id?: string;
onItemClick?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,7 @@ export type CustomCallControlButtonPlacement = 'primary' | 'overflow' | 'seconda
// @public
export interface CustomCallControlButtonProps {
disabled?: boolean;
dismissDrawer?: boolean;
iconName?: string;
id?: string;
onItemClick?: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export interface _DrawerMenuItemProps {
* Aria label for the menu item
*/
ariaLabel?: string;
/**
* Dismiss the drawer menu when the button is clicked
*/
dismissDrawer?: boolean;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export interface CustomCallControlButtonProps {
* Optional strings to override in component
*/
strings?: CustomCallControlButtonStrings;
/**
* Dismiss the drawer menu when the button is clicked
*
* @defaultValue true
*/
dismissDrawer?: boolean;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,17 @@ export const MoreDrawer = (props: MoreDrawerProps): JSX.Element => {
drawerMenuItems.push(element);
});
customDrawerButtons['overflow'].forEach((element) => {
const customButtonProps = { ...element };
// Default Auto dismiss drawer on click unless specified
if (customButtonProps.dismissDrawer !== false) {
element = {
...customButtonProps,
onItemClick: () => {
customButtonProps.onItemClick?.();
onLightDismiss();
}
};
}
drawerMenuItems.push(element);
});
return (
Expand Down