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 all 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 @@ -928,6 +940,10 @@ export class MgtPeoplePicker extends MgtTemplatedTaskComponent {
const graph = provider.graph.forComponent(this);

if (!input.length) {
if (this.disableSuggestions) {
this._foundPeople = [];
return;
}
if (this.defaultPeople) {
people = this.defaultPeople;
} else {
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