Skip to content

Commit

Permalink
feat: add popupProps to Modal component to allow override internal Po…
Browse files Browse the repository at this point in the history
…pup props (#24693)

Co-authored-by: Gaston Ramirez <[email protected]>
  • Loading branch information
gastonframirez and Gaston Ramirez authored Sep 21, 2022
1 parent 92bc886 commit 62aadfe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "@fluentui/react: allowing Popup configuration on Modal component",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/react/etc/react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6983,6 +6983,7 @@ export interface IModalProps extends React_2.RefAttributes<HTMLDivElement>, IAcc
// @deprecated
onLayerDidMount?: () => void;
overlay?: IOverlayProps;
popupProps?: IPopupProps;
responsiveMode?: ResponsiveMode;
scrollableContentClassName?: string;
styles?: IStyleFunctionOrObject<IModalStyleProps, IModalStyles>;
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Modal/Modal.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const ModalBase: React.FunctionComponent<IModalProps> = React.forwardRef<
onDismissed,
// eslint-disable-next-line deprecation/deprecation
enableAriaHiddenSiblings,
popupProps,
} = props;

const rootRef = React.useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -477,6 +478,7 @@ export const ModalBase: React.FunctionComponent<IModalProps> = React.forwardRef<
// Popup will automatically handle this based on the aria-modal setting.
enableAriaHiddenSiblings={enableAriaHiddenSiblings}
aria-modal={!isModeless}
{...popupProps}
>
<div className={classNames.root} role={!isModeless ? 'document' : undefined}>
{!isModeless && (
Expand Down
6 changes: 6 additions & 0 deletions packages/react/src/components/Modal/Modal.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { ILayerProps } from '../../Layer';
import type { IOverlayProps } from '../../Overlay';
import type { IStyle, ITheme } from '../../Styling';
import type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
import { IPopupProps } from '../Popup/Popup.types';

export interface IDragOptions {
/**
Expand Down Expand Up @@ -195,6 +196,11 @@ export interface IModalProps extends React.RefAttributes<HTMLDivElement>, IAcces
* @default `{}`
*/
focusTrapZoneProps?: IFocusTrapZoneProps;

/**
* Props to be passed through to Popup
*/
popupProps?: IPopupProps;
}

/**
Expand Down

0 comments on commit 62aadfe

Please sign in to comment.