Skip to content

Commit 35ab435

Browse files
committed
Merge branch 'listview-state-fix' of https://github.com/thespooler/sp-dev-fx-controls-react into thespooler-listview-state-fix
2 parents 3a3ed4f + 33acd9c commit 35ab435

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/controls/listView/ListView.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
111111
*/
112112
public componentDidUpdate(prevProps: IListViewProps, prevState: IListViewState): void {
113113

114-
if (!isEqual(prevProps, this.props)) {
114+
if (!isEqual(this._filterFunctions(prevProps), this._filterFunctions(this.props))) {
115115
// select default items
116116
this._setSelectedItems();
117117
// Reset the selected items
@@ -550,6 +550,16 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
550550
return result;
551551
}
552552

553+
private _filterRenderFunction(f: IViewField) {
554+
const { render, ...fields } = f;
555+
return fields;
556+
}
557+
558+
private _filterFunctions(p: IListViewProps) {
559+
const { selection: s, viewFields: v, ...otherProps } = p;
560+
return { ...otherProps, viewFields: (v || []).map(this._filterRenderFunction) };
561+
}
562+
553563
/**
554564
* Stop listeners from onDragOver event.
555565
* @param e

0 commit comments

Comments
 (0)