Skip to content

Commit ae3c0b1

Browse files
authored
fix: make people-picker aria-label work in firefox (#1963)
1 parent ab34e64 commit ae3c0b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
684684
return html``;
685685
}
686686

687+
// aria-label needs to provide a falsy default to avoid setting the attribute to "undefined" or "null"
688+
// direct used of the ariaLabel property on the input element only works in Chromium browsers
687689
return html`
688690
<div class="${classMap(inputClasses)}">
689691
<input
@@ -693,7 +695,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
693695
role="combobox"
694696
placeholder=${placeholder}
695697
autocomplete="off"
696-
.ariaLabel=${this.ariaLabel}
698+
aria-label=${this.ariaLabel || ''}
697699
aria-controls="suggestions-list"
698700
aria-haspopup="listbox"
699701
aria-autocomplete="list"

0 commit comments

Comments
 (0)