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

feat: add ability to disable suggestions on people-picker #3048

Merged
merged 5 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,18 @@ export class MgtPeoplePicker extends MgtTemplatedTaskComponent {
})
public ariaLabel: string;

/**
* Sets whether the people suggestions should apper on the suggestion list
*
* @type {boolean}
* @memberof MgtPerson
*/
@property({
attribute: 'disable-suggestions',
type: Boolean
})
public disableSuggestions = false;

/**
* Get the scopes required for people picker
*
Expand Down Expand Up @@ -1006,6 +1018,7 @@ export class MgtPeoplePicker extends MgtTemplatedTaskComponent {
people = groups;
}
this.defaultPeople = people;
people = this.disableSuggestions ? [] : people;
gavinbarron marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ closeModal.addEventListener('click', () => {
</script>
`;

export const disableSuggestions = () => html`
<mgt-people-picker disable-suggestions></mgt-people-picker>
`;

export const dynamicGroupId = () => html`
<mgt-people-picker id="picker"></mgt-people-picker>
<div>
Expand Down
Loading