Skip to content

Commit df20069

Browse files
Fix issue with Throttling and Scrolling in FilePicker component
1 parent 50c17b0 commit df20069

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/controls/filePicker/controls/FileBrowser/FileBrowser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,15 @@ export class FileBrowser extends React.Component<IFileBrowserProps, IFileBrowser
507507

508508

509509
// Remove the null mark from the end of the items array
510-
if (concatenateResults && items && items.length > 0 && items.length[items.length - 1] === null) {
510+
if (concatenateResults && items && items.length > 0 && items[items.length - 1] === null) {
511511
// Remove the null mark
512512
items.splice(items.length - 1, 1);
513513
}
514514
//concatenate results
515515
const newItems = concatenateResults ? items.concat(filesQueryResult.items) : filesQueryResult.items;
516516

517517
// If there are more items to load -> add null mark at the end of the array
518-
if (filesQueryResult.nextHref !== null) {
518+
if (filesQueryResult.nextHref) {
519519
newItems.push(null);
520520
}
521521

src/controls/filePicker/controls/TilesList/TilesList.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ export class TilesList extends React.Component<ITilesListProps> {
6161
return (
6262
<SelectionZone selection={this.props.selection} onItemInvoked={(item: IFile) => { this._handleItemInvoked(item); }}>
6363
<FocusZone>
64-
<List
65-
ref={(e: List) => { this._listElem = e; }}
66-
className={styles.folderList}
67-
items={this.props.items}
68-
getItemCountForPage={this._getItemCountForPage}
69-
getPageHeight={this._getPageHeight}
70-
onRenderPage={(pageProps: IPageProps, defaultRender?: IRenderFunction<IPageProps>) => this._onRenderPage(pageProps, defaultRender)}
71-
/>
64+
<div data-is-scrollable>
65+
<List
66+
ref={(e: List) => { this._listElem = e; }}
67+
className={styles.folderList}
68+
items={this.props.items}
69+
getItemCountForPage={this._getItemCountForPage}
70+
getPageHeight={this._getPageHeight}
71+
onRenderPage={(pageProps: IPageProps, defaultRender?: IRenderFunction<IPageProps>) => this._onRenderPage(pageProps, defaultRender)}
72+
/>
73+
</div>
7274
</FocusZone>
7375
</SelectionZone>
7476
);

0 commit comments

Comments
 (0)