Sp-dev-fx-controls-react: ListView select not working

Created on 9 Mar 2019  路  6Comments  路  Source: pnp/sp-dev-fx-controls-react

Category

  • [ ] Enhancement
  • [x] Bug
  • [ ] Question

Version

1.12.0

Expected / Desired Behavior / Question

When putting a ListView inside a React Component that controls its items and selection props, an item should be selectable.

Observed Behavior

When putting a ListView inside a React Component, anything that trigger componentDidUpdate, like setState or a prop change, will cause an invalidation of the items selection and cause an invalid call to props.selection().

Steps to Reproduce

Call setState on a component containing a ListView with a selected item and watch the selection disapear.
Handy reproduction: https://github.com/thespooler/listview-bughunt

fixed-next-drop bug

Most helpful comment

v2.5.0 has been released.

All 6 comments

I would suspect that using isEqual in componentDidUpdate might not behave in the expected way. If the select() function is bound in render(), as lodash does strict equality comparison on functions, it likely will always return false.

Any update on this bug. It prevents anything beyond creating samples - no real world application for this control is possible beyond just displaying list data.

If this PR goes through, that should fix this issue.
This isn't perfect, but now at least, it should basically work.

Hi @thespooler, @jchilde

The fix has been merged and will be included in the next release.

In a meanwhile you can test the functionality in beta version.

Fantastic!

v2.5.0 has been released.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joelfmrodrigues picture joelfmrodrigues  路  4Comments

bva999 picture bva999  路  5Comments

Arknev picture Arknev  路  3Comments

repolife picture repolife  路  7Comments

AriGunawan picture AriGunawan  路  8Comments