Skip to content

Commit

Permalink
feat: add ability to disable suggestions on people-picker (#3048)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnickii authored Feb 26, 2024
1 parent c572c01 commit f174714
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
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

0 comments on commit f174714

Please sign in to comment.