Skip to content

Commit

Permalink
Fix for #55
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Apr 5, 2018
1 parent c7ce305 commit 269e3f3
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Releases

## 1.2.5

**Fixes**

- Undo `ListView` item selection after items array updates [#55](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/55)

## 1.2.4

**Enhancements**
Expand All @@ -8,7 +14,7 @@

**Fixes**

- iFrame dialog reference fix [#52 - Need some more implementation documentation on IFrameDialog](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)
- iFrame dialog reference fix [#52](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)

## 1.2.3

Expand Down
8 changes: 7 additions & 1 deletion docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Releases

## 1.2.5

**Fixes**

- Undo `ListView` item selection after items array updates [#55](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/55)

## 1.2.4

**Enhancements**
Expand All @@ -8,7 +14,7 @@

**Fixes**

- iFrame dialog reference fix [#52 - Need some more implementation documentation on IFrameDialog](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)
- iFrame dialog reference fix [#52](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/52)

## 1.2.3

Expand Down
4 changes: 3 additions & 1 deletion docs/documentation/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Reusable React controls for your SharePoint Framework solutions
# Reusable React controls for your SharePoint Framework solutions ![](https://img.shields.io/npm/v/@pnp/spfx-controls-react.svg)

This repository provides developers with a set of reusable React controls that can be used in SharePoint Framework (SPFx) solutions. The project provides controls for building web parts and extensions.

!!! attention The controls project has a minimal dependency on SharePoint Framework version `1.3.0`. Be aware that the controls might not work in solutions your building for on-premises. As for on-premises solutions version `1.1.0` is currently used.

## Getting started

### Installation
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,12 @@
"url": "https://github.com/SharePoint/sp-dev-fx-controls-react/issues"
},
"main": "lib/index.js",
"homepage": "https://github.com/SharePoint/sp-dev-fx-controls-react"
"homepage": "https://github.com/SharePoint/sp-dev-fx-controls-react",
"contributors": [
"Gove, Russell <russellgove@gmail.com>",
"Kent Chris <>",
"Rodrigues, Joel <>",
"Struyf, Elio <info@estruyf.be>",
"Terentiev, Alex <>"
]
}
3 changes: 3 additions & 0 deletions src/controls/listView/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class ListView extends React.Component<IListViewProps, IListViewState> {
this._setSelectedItems();

if (!isEqual(prevProps, this.props)) {
// Reset the selected items
this._selection.setItems(this.props.items, true);
// Process list view properties
this._processProperties();
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/webparts/controlsTest/components/ControlsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
console.log('Items:', items);
}

/**
* Deletes second item from the list
*/
private deleteItem = () => {
const { items } = this.state;
if (items.length >= 2) {
items.splice(1, 1);
this.setState({
items: items
});
}
}

/**
* Renders the component
*/
Expand Down Expand Up @@ -212,6 +225,8 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
compact={true}
selectionMode={SelectionMode.multiple}
selection={this._getSelection} />

<p><a href="javascript:;" onClick={this.deleteItem}>Deletes second item</a></p>
</div>
);
}
Expand Down

0 comments on commit 269e3f3

Please sign in to comment.