spfx peoplepicker- change state on remove suggestion
-
24-01-2021 - |
문제
I want to change a state when the user remove a person from people picker?
<NormalPeoplePicker
onChange={this._onChange.bind(this)}
onResolveSuggestions={this._onFilterChanged}
getTextFromItem={(persona: IPersonaProps) => persona.primaryText}
pickerSuggestionsProps={suggestionProps}
className={'ms-PeoplePicker'}
key={'normal'}
itemLimit={1}
// defaultSelectedItems={this.state.selectedItems}
onRemoveSuggestion={}
/>
Thanks
해결책
We have to use the onChange method on the component private _onChange = (items: IPersonaProps[]) => { this.setState({ selectedItems: items }); } See my detailed post regarding this implementation http://www.thesharepointguide.com/sharepoint-framework-office-ui-fabric/
Hope this helps
제휴하지 않습니다 sharepoint.stackexchange