Skip to content

Commit c5354b7

Browse files
committed
case sensitivity for type
1 parent d173a26 commit c5354b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
108108
@property({
109109
attribute: 'type',
110110
converter: (value, type) => {
111+
const capitalize = s => {
112+
if (typeof s !== 'string') {
113+
return '';
114+
}
115+
return s.charAt(0).toUpperCase() + s.toLowerCase().slice(1);
116+
};
117+
value = capitalize(value);
111118
if (!value || value.length === 0) {
112119
return PersonType.Any;
113120
}
@@ -712,7 +719,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
712719
}
713720
}
714721
// default group search without user input
715-
if ((input.length === 0 && this.type === PersonType.Group) || this.type === PersonType.Any) {
722+
if (input.length === 0 && this.type === PersonType.Group) {
716723
people = [];
717724
try {
718725
const groups = (await findGroups(graph, '', this.showMax, GroupType.Any)) || [];

0 commit comments

Comments
 (0)