pnp / pnp/sp-dev-fx-controls-react
ListItemPicker - How to get 'defaultSelectedItems' to set value
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
Category
[ ] Enhancement
[ ] Bug
[X] Question
Version
Please specify what version of the library you are using: [ 3.15.0 ]
If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.
Expected / Desired Behavior / Question
I have a ListItemPicker that I render in a DynamicForm using the 'fieldOverrides' and when setting the 'defaultSelectedItems' in the ListItemPicker , the default selection shows up fine, but when I click 'Save' the value is not sent as part of the request, only values for other fields are passed in the request. How do I get it to set the default value so it can be included in the request?
Observed Behavior
When setting the 'defaultSelectedItems', I have to remove the selected item and the select it again to have it fire the 'onChanged' and then it updates the value, otherwise, if I just leave the default selection, then it doesn't include it in the request.
Steps to Reproduce
N/A
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ListItemPicker used through DynamicForm fieldOverrides and reproduce the case described with defaultSelectedItems. Trace how the default selection reaches onChanged and the Save request; done means the unchanged default selection is included in the submitted value without removing and reselecting it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100