diff --git a/common/changes/office-ui-fabric-react/no-dismiss-callout_2018-06-04-21-44.json b/common/changes/office-ui-fabric-react/no-dismiss-callout_2018-06-04-21-44.json new file mode 100644 index 0000000000000..4cfb771e03fb7 --- /dev/null +++ b/common/changes/office-ui-fabric-react/no-dismiss-callout_2018-06-04-21-44.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Callout: Add `preventDismissOnLostFocus` prop.", + "type": "minor" + } + ], + "packageName": "office-ui-fabric-react", + "email": "jetao@microsoft.com" +} diff --git a/packages/office-ui-fabric-react/src/components/Callout/Callout.types.ts b/packages/office-ui-fabric-react/src/components/Callout/Callout.types.ts index 04b45f9e95b08..3e7f55596738a 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/Callout.types.ts +++ b/packages/office-ui-fabric-react/src/components/Callout/Callout.types.ts @@ -73,11 +73,17 @@ export interface ICalloutProps { isBeakVisible?: boolean; /** - * If true then the onClose will not not dismiss on scroll + * If true then the callout will not dismiss on scroll * @default false */ preventDismissOnScroll?: boolean; + /** + * If true then the callout will not dismiss when it loses focus + * @default false + */ + preventDismissOnLostFocus?: boolean; + /** * If true the position returned will have the menu element cover the target. * If false then it will position next to the target; diff --git a/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx b/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx index 9ecac34114b70..828f7bca0e14e 100644 --- a/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx +++ b/packages/office-ui-fabric-react/src/components/Callout/CalloutContent.base.tsx @@ -51,6 +51,7 @@ export interface ICalloutState { @customizable('CalloutContent', ['theme']) export class CalloutContentBase extends BaseComponent { public static defaultProps = { + preventDismissOnLostFocus: false, preventDismissOnScroll: false, isBeakVisible: true, beakWidth: 16, @@ -234,13 +235,15 @@ export class CalloutContentBase extends BaseComponent