Skip to content

Commit 721dbe4

Browse files
authored
fix: people picker option labels (#2207)
options in people picker suggestions now include job title or mail in aria-label
1 parent aafdc5e commit 721dbe4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,6 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
937937
*/
938938
protected renderSearchResults(people: IDynamicPerson[]) {
939939
const filteredPeople = people.filter(person => person.id);
940-
941940
return html`
942941
<ul
943942
id="suggestions-list"
@@ -950,14 +949,16 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
950949
filteredPeople,
951950
person => person.id,
952951
person => {
952+
const lineTwo = person.jobTitle || (person as User).mail;
953+
const ariaLabel = `${this.strings.suggestedContact} ${person.displayName} ${lineTwo}`;
953954
return html`
954955
<li
955956
id="${person.id}"
956-
aria-label=" ${this.strings.suggestedContact} ${person.displayName}"
957+
aria-label="${ariaLabel}"
957958
class="list-person"
958959
role="option"
959960
@click="${e => this.handleSuggestionClick(person)}">
960-
${this.renderPersonResult(person)}
961+
${this.renderPersonResult(person)}
961962
</li>
962963
`;
963964
}

0 commit comments

Comments
 (0)