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 00000000000000..4cfb771e03fb70 --- /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 bedfebac1a9610..202667eb5332d2 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 @@ -92,11 +92,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 4e3f9e540c3c52..c65849619a8853 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 @@ -58,6 +58,7 @@ export interface ICalloutState { export class CalloutContentBase extends BaseComponent { public static defaultProps = { + preventDismissOnLostFocus: false, preventDismissOnScroll: false, isBeakVisible: true, beakWidth: 16, @@ -253,13 +254,15 @@ export class CalloutContentBase extends BaseComponent