diff --git a/common/changes/@uifabric/utilities/zhiliu-groupingOp_2018-02-19-19-18.json b/common/changes/@uifabric/utilities/zhiliu-groupingOp_2018-02-19-19-18.json new file mode 100644 index 00000000000000..7e6a7040b58223 --- /dev/null +++ b/common/changes/@uifabric/utilities/zhiliu-groupingOp_2018-02-19-19-18.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/utilities", + "comment": "fix bug in IE that IE does not support Number.IsInteger", + "type": "patch" + } + ], + "packageName": "@uifabric/utilities", + "email": "zhiliu@microsoft.com" +} \ No newline at end of file diff --git a/common/changes/office-ui-fabric-react/zhiliu-groupingOp_2018-02-19-19-18.json b/common/changes/office-ui-fabric-react/zhiliu-groupingOp_2018-02-19-19-18.json new file mode 100644 index 00000000000000..0746a1f0dcb2df --- /dev/null +++ b/common/changes/office-ui-fabric-react/zhiliu-groupingOp_2018-02-19-19-18.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "make onShouldVirtualize work for grouped list", + "type": "minor" + } + ], + "packageName": "office-ui-fabric-react", + "email": "zhiliu@microsoft.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/GroupedList/GroupedList.tsx b/packages/office-ui-fabric-react/src/components/GroupedList/GroupedList.tsx index 5d3718724f1ea0..09928c43ccc202 100644 --- a/packages/office-ui-fabric-react/src/components/GroupedList/GroupedList.tsx +++ b/packages/office-ui-fabric-react/src/components/GroupedList/GroupedList.tsx @@ -152,7 +152,8 @@ export class GroupedList extends BaseComponent ); } diff --git a/packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx b/packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx index dbe28257e814e6..43bd96e8b96e5d 100644 --- a/packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx +++ b/packages/office-ui-fabric-react/src/components/GroupedList/GroupedListSection.tsx @@ -36,6 +36,8 @@ import { import { assign, css } from '../../Utilities'; import { IViewport } from '../../utilities/decorators/withViewport'; import * as stylesImport from './GroupedList.scss'; +import { IList, IListProps } from '../List/index'; + const styles: any = stylesImport; export interface IGroupedListSectionProps extends React.Props { @@ -104,6 +106,14 @@ export interface IGroupedListSectionProps extends React.Props; + + /** + * Optional callback to determine whether the list should be rendered in full, or virtualized. + * Virtualization will add and remove pages of items as the user scrolls them into the visible range. + * This benefits larger list scenarios by reducing the DOM on the screen, but can negatively affect performance for smaller lists. + * The default implementation will virtualize when this callback is not provided. + */ + onShouldVirtualize?: (props: IListProps) => boolean; } export interface IGroupedListSectionState { @@ -182,7 +192,8 @@ export class GroupedListSection extends BaseComponent ) : this._onRenderGroup(renderCount) @@ -303,7 +315,8 @@ export class GroupedListSection extends BaseComponent ); @@ -339,7 +353,8 @@ export class GroupedListSection extends BaseComponent 0) ? ( @@ -365,6 +380,7 @@ export class GroupedListSection extends BaseComponent ) : null; } diff --git a/packages/utilities/src/FabricPerformance.ts b/packages/utilities/src/FabricPerformance.ts index 3fba65ed999ba5..4554b63a7485c1 100644 --- a/packages/utilities/src/FabricPerformance.ts +++ b/packages/utilities/src/FabricPerformance.ts @@ -50,7 +50,7 @@ export class FabricPerformance { * @param func - The logic to be measured for execution time */ public static measure(name: string, func: () => void): void { - if (Number.isInteger(FabricPerformance._timeoutId)) { + if (FabricPerformance._timeoutId) { FabricPerformance.setPeriodicReset(); } const start = now();