Skip to content

Commit 7b0ab4a

Browse files
authored
Merge pull request #697 from aaclage/Feature/FixListViewStickyReferences
Feature > ListView > StickyHeader > Code consistency
2 parents 6cf2e06 + 41f55b5 commit 7b0ab4a

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

src/controls/listView/ListView.stickyHeader.css

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.StickyHeader {
2+
:global(.ms-FocusZone) {
3+
max-height: 40vh;
4+
overflow-y: overlay;
5+
overflow-x: hidden;
6+
}
7+
:global(.ms-DetailsHeader) {
8+
overflow-y: hidden;
9+
}
10+
}

src/controls/listView/ListView.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react';
22
import styles from './ListView.DragDrop.module.scss';
3+
import stickyHeaderstyles from './ListView.stickyHeader.module.scss';
34
import { DetailsList, DetailsListLayoutMode, Selection, SelectionMode, IGroup, IDetailsHeaderProps } from 'office-ui-fabric-react/lib/DetailsList';
45
import { IListViewProps, IListViewState, IViewField, IGrouping, GroupOrder } from './IListView';
56
import { IColumn, IGroupRenderProps, IObjectWithKey } from 'office-ui-fabric-react/lib/components/DetailsList';
@@ -9,7 +10,6 @@ import * as strings from 'ControlStrings';
910
import { IGroupsItems } from './IListView';
1011
import * as telemetry from '../../common/telemetry';
1112
import { Icon } from 'office-ui-fabric-react/lib/Icon';
12-
import './ListView.stickyHeader.css';
1313

1414
import filter from 'lodash/filter';
1515
import { SearchBox } from 'office-ui-fabric-react/lib/SearchBox';
@@ -564,18 +564,6 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
564564
this.dragCounter = 0;
565565
}
566566
}
567-
568-
/**
569-
* Return Classname with StickyHeader
570-
*/
571-
private _getClassName() {
572-
if (this.props.stickyHeader) {
573-
return "StickyHeader";
574-
} else {
575-
return "";
576-
}
577-
}
578-
579567
/**
580568
* Default React component render method
581569
*/
@@ -623,7 +611,10 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
623611
compact={compact}
624612
setKey="ListViewControl"
625613
groupProps={groupProps}
626-
className={this._getClassName()}
614+
className={
615+
stickyHeader &&
616+
stickyHeaderstyles.StickyHeader
617+
}
627618
/>
628619
</div>
629620
);

0 commit comments

Comments
 (0)