diff --git a/common/changes/@uifabric/dashboard/addCardDGLFunctionality_2018-12-03-01-02.json b/common/changes/@uifabric/dashboard/addCardDGLFunctionality_2018-12-03-01-02.json new file mode 100644 index 00000000000000..f2ca0e0c68afc8 --- /dev/null +++ b/common/changes/@uifabric/dashboard/addCardDGLFunctionality_2018-12-03-01-02.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/dashboard", + "comment": "Using _async fabric utility functions to prevent timeout leaks", + "type": "patch" + } + ], + "packageName": "@uifabric/dashboard", + "email": "nulikarthik@gmail.com" +} \ No newline at end of file diff --git a/packages/dashboard/src/components/DashboardGridLayout/AddCardPanel/AddCardPanel.tsx b/packages/dashboard/src/components/DashboardGridLayout/AddCardPanel/AddCardPanel.tsx index 42f0c07856db2c..c824e21a5e59c1 100644 --- a/packages/dashboard/src/components/DashboardGridLayout/AddCardPanel/AddCardPanel.tsx +++ b/packages/dashboard/src/components/DashboardGridLayout/AddCardPanel/AddCardPanel.tsx @@ -1,18 +1,17 @@ import * as React from 'react'; import { Panel, PanelType } from 'office-ui-fabric-react/lib/Panel'; -import { classNamesFunction } from 'office-ui-fabric-react/lib/Utilities'; +import { classNamesFunction, BaseComponent } from 'office-ui-fabric-react/lib/Utilities'; import { AddCard } from './AddCard/AddCard'; import { getStyles } from './AddCardPanel.styles'; import { IAddCardPanelProps, IAddCardPanelState, IAddCardPanelStyles } from './AddCardPanel.types'; import { IDGLCard } from '../../../index'; -export class AddCardPanel extends React.Component { +export class AddCardPanel extends BaseComponent { constructor(props: IAddCardPanelProps) { super(props); this.state = { - isOpen: false, flyoutStyle: {} }; } @@ -36,7 +35,9 @@ export class AddCardPanel extends React.Component { - this.setState({ isOpen: false }); + if (this.props.onDismiss) { + this.props.onDismiss(); + } }; private _renderAddCardItems = (addCardItems: IDGLCard[], header: string): JSX.Element => { @@ -87,7 +88,7 @@ export class AddCardPanel extends React.Component