From d020de65d47f5602f873e0aa296eee01c4de183a Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 5 Apr 2018 20:27:29 +0200 Subject: [PATCH] Fix for #55 --- CHANGELOG.md | 8 +++++++- docs/documentation/docs/about/release-notes.md | 8 +++++++- docs/documentation/docs/index.md | 4 +++- package.json | 11 +++++++++-- src/controls/listView/ListView.tsx | 3 +++ .../controlsTest/components/ControlsTest.tsx | 15 +++++++++++++++ 6 files changed, 44 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df5afc39f..6afe0c82b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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** @@ -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 diff --git a/docs/documentation/docs/about/release-notes.md b/docs/documentation/docs/about/release-notes.md index b745d378c..2787eff18 100644 --- a/docs/documentation/docs/about/release-notes.md +++ b/docs/documentation/docs/about/release-notes.md @@ -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** @@ -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 diff --git a/docs/documentation/docs/index.md b/docs/documentation/docs/index.md index efbaa58e2..92720b5d4 100644 --- a/docs/documentation/docs/index.md +++ b/docs/documentation/docs/index.md @@ -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 diff --git a/package.json b/package.json index 9aa874d14..4a30c51ed 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@pnp/spfx-controls-react", "description": "Reusable React controls for SharePoint Framework solutions", - "version": "1.2.4", + "version": "1.2.5", "engines": { "node": ">=0.10.0" }, @@ -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 ", + "Kent Chris <>", + "Rodrigues, Joel <>", + "Struyf, Elio ", + "Terentiev, Alex <>" + ] } diff --git a/src/controls/listView/ListView.tsx b/src/controls/listView/ListView.tsx index 1ddf2a50a..2804bafde 100644 --- a/src/controls/listView/ListView.tsx +++ b/src/controls/listView/ListView.tsx @@ -59,6 +59,9 @@ export class ListView extends React.Component { this._setSelectedItems(); if (!isEqual(prevProps, this.props)) { + // Reset the selected items + this._selection.setItems(this.props.items, true); + // Process list view properties this._processProperties(); } } diff --git a/src/webparts/controlsTest/components/ControlsTest.tsx b/src/webparts/controlsTest/components/ControlsTest.tsx index 9c395765b..914926066 100644 --- a/src/webparts/controlsTest/components/ControlsTest.tsx +++ b/src/webparts/controlsTest/components/ControlsTest.tsx @@ -70,6 +70,19 @@ export default class ControlsTest extends React.Component { + const { items } = this.state; + if (items.length >= 2) { + items.splice(1, 1); + this.setState({ + items: items + }); + } + } + /** * Renders the component */ @@ -212,6 +225,8 @@ export default class ControlsTest extends React.Component + +

Deletes second item

); }