This branch of the code is encountered when a list of groups is requested and group-type is not any. In this branch, top is not used (this parameter derives from show-max), whereas in the other branch (used when group-type is "any"), the parameter is used.
If it's impossible to respect the "show-max" attribute in this case (since there's a batched call involved, and the implementation could get clunky), this corner case should be at least documented.
To Reproduce
(using the react wrapper)
create a component like this:
<PeoplePicker type={PersonType.group} groupType={GroupType.unified | GroupType.security | GroupType.mailenabledsecurity} showMax={4}/>
Notice that the component shows lots of groups.
Change groupType to groupType={GroupType.any}
Now at most 4 groups are displayed.
Environment (please complete the following information):
OS: Windows 11
Browser: Chrome
Framework: react 17
Context: SharePoint
Version: 3.1.3
Provider: SharePointProvider (default configuration with this.context from a web part)
Describe the bug When an component is used with type=group and group-type different from "any", the show-max property is ignored.
I traced the reason to: https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/3695be96044ee2187dad474b55a5e4c4ffd7682e/packages/mgt-components/src/graph/graph.groups.ts#L129
This branch of the code is encountered when a list of groups is requested and group-type is not any. In this branch, top is not used (this parameter derives from show-max), whereas in the other branch (used when group-type is "any"), the parameter is used.
If it's impossible to respect the "show-max" attribute in this case (since there's a batched call involved, and the implementation could get clunky), this corner case should be at least documented.
To Reproduce (using the react wrapper) create a component like this:
<PeoplePicker type={PersonType.group} groupType={GroupType.unified | GroupType.security | GroupType.mailenabledsecurity} showMax={4}/>
Notice that the component shows lots of groups.Change groupType to groupType={GroupType.any}
Now at most 4 groups are displayed.
Environment (please complete the following information):