From 9aa490ecaf43f8a1aef07c75ed88e3544e635498 Mon Sep 17 00:00:00 2001 From: David Zearing Date: Tue, 20 Feb 2018 19:49:05 -0800 Subject: [PATCH 1/2] Fixing Dialog/Modal default props. --- .../src/components/Dialog/Dialog.base.tsx | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/packages/office-ui-fabric-react/src/components/Dialog/Dialog.base.tsx b/packages/office-ui-fabric-react/src/components/Dialog/Dialog.base.tsx index 8e8a7b26de4477..dc8434d5d3f6d2 100644 --- a/packages/office-ui-fabric-react/src/components/Dialog/Dialog.base.tsx +++ b/packages/office-ui-fabric-react/src/components/Dialog/Dialog.base.tsx @@ -5,28 +5,30 @@ import { getId } from '../../Utilities'; import { IDialogProps } from './Dialog.types'; -import { DialogType } from './DialogContent.types'; -import { Modal } from '../../Modal'; +import { DialogType, IDialogContentProps } from './DialogContent.types'; +import { Modal, IModalProps } from '../../Modal'; import { withResponsiveMode } from '../../utilities/decorators/withResponsiveMode'; import * as stylesImport from './Dialog.scss'; const styles: any = stylesImport; import { DialogContent } from './DialogContent'; +const DefaultModalProps: IModalProps = { + isDarkOverlay: false, + isBlocking: false, + className: '', + containerClassName: '' +}; + +const DefaultDialogContentProps: IDialogContentProps = { + type: DialogType.normal, + className: '', + topButtonsProps: [], +}; + @withResponsiveMode export class DialogBase extends BaseComponent { public static defaultProps: IDialogProps = { - modalProps: { - isDarkOverlay: true, - isBlocking: false, - className: '', - containerClassName: '' - }, - dialogContentProps: { - type: DialogType.normal, - className: '', - topButtonsProps: [], - }, hidden: true, }; @@ -78,12 +80,20 @@ export class DialogBase extends BaseComponent { type, contentClassName, topButtonsProps, - dialogContentProps, - modalProps, containerClassName, hidden } = this.props; + const modalProps = { + ...DefaultModalProps, + ...this.props.modalProps + }; + + const dialogContentProps: IDialogContentProps = { + ...DefaultDialogContentProps, + ...this.props.dialogContentProps + }; + return ( Date: Tue, 20 Feb 2018 19:49:42 -0800 Subject: [PATCH 2/2] Adding change file. --- .../fix-dialog-props_2018-02-21-03-49.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/office-ui-fabric-react/fix-dialog-props_2018-02-21-03-49.json diff --git a/common/changes/office-ui-fabric-react/fix-dialog-props_2018-02-21-03-49.json b/common/changes/office-ui-fabric-react/fix-dialog-props_2018-02-21-03-49.json new file mode 100644 index 00000000000000..b5dc779ec7e7eb --- /dev/null +++ b/common/changes/office-ui-fabric-react/fix-dialog-props_2018-02-21-03-49.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Dialog: default modal props now respective (Modal rendered with light background.)", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "dzearing@microsoft.com" +} \ No newline at end of file