Skip to content
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

@pnp/spfx-controls-react/lib/PeoplePicker control return only one value at a time i need object of username and email #633

Open
thedeepponkiya opened this issue Dec 24, 2024 · 0 comments

Comments

@thedeepponkiya
Copy link

in @pnp/spfx-controls-react/lib/PeoplePicker control when i select one user that control return object but when i edit manage content selected user not display in peoplepiker control

i need object of username and email and update people piker control in manage content custom control

{
id: EVENTS_MANAGE_CONTENT_FIELD_KEY_VALUE.PUBLISH_BY_ID,
title: EVENTS_MANAGE_CONTENT_FIELD_KEY_VALUE.PUBLISH_BY_LABEL,
type: CustomCollectionFieldType.custom,
required: DEFAULT_DATA_TYPE_VALUE.TRUE,
onCustomRender: (field, value, onUpdate, item, itemId, onError) => {
return React.createElement(PeoplePicker, {
context: this.context as any,
personSelectionLimit: 1,
showtooltip: DEFAULT_DATA_TYPE_VALUE.TRUE,
key: itemId,
defaultSelectedUsers: item?.customFieldId,
onChange: (items: any = []) => {
const { text, secondaryText } = items[0];
item.customFieldId = [{ text: text, secondaryText: secondaryText }];
onUpdate(field?.id, [{ text: text, secondaryText: secondaryText }]);
},
showHiddenInUI: DEFAULT_DATA_TYPE_VALUE.FALSE,
principalTypes: [PrincipalType.User],
});
},
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant