-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListPicker Selection change not working properly when we set the selectedList using setState #315
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
After some research we think it's related to the control pushing all found lists to the _options, without checking if the item is already in this list. As this function is also called on any change done to the selected item it will duplicate all items again and again on change. It's unclear to us why this issue started after upgrading our project. A proposed solution would be to check if the item is already in the list before pushing; results.value.map(list => {
if (!this.optionsContainsList(list)) {
this._options.push({
key: list.Id,
text: list.Title
});
}
}); |
This should have been fixed. You can test it out in the latest beta version and will be available in |
Thank you for providing the fix, Its working fine with beta version. Could we know the planned target date for 1.14.0 release. |
Release date would be later this week or next week, depends on the other fixes that are waiting to be verified. |
This is now included within the |
Category
[ ] Enhancement
[X] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 1.13.2 ]
Expected / Desired Behavior / Question
On selection change, selectedList should be highlighted and options should not be repeated
Observed Behavior
On ListPicker selection change, selectedList is getting highlighted but the options are binding again
Steps to Reproduce
After migrating my project from SPFx 1.6 to SPFx 1.8.2 I started seeing this issue.
If we don't set the selectionList from state then we wont have issue. But in my scenario I need to set the selectedList from state and it should be stored back to the state on selectionChanged event
The text was updated successfully, but these errors were encountered: