Skip to content

ListItemPicker : when props are updated the selected items are always reset event if it should not #2008

Open
@PierreBiname

Description

@PierreBiname

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version

3.21.0

Expected / Desired Behavior / Question

When props are updated, this.state.selectedItems is erased evetn if it shoud not.

Observed Behavior

If a property the disabled is updated from true to false, all items are shown in the suggested list even the those from defaultSelectedItems.

Steps to Reproduce

Create the picker with default values and with the disabled property set to true. The update the property disabled to false.

Submission Guidelines

In the file ListItemPicker.tsx in the function UNSAFE_componentWillReceiveProps replace the first line
let newSelectedItems: any[] | undefined; by let newSelectedItems = this.state.selectedItems;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions