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,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 @@ -6977,6 +6977,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