Skip to content

[BUG] people-picker: showMax has no effect with type = group and group-type != any #3288

Description

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:

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)

Metadata

Metadata

Type

No type

Projects

Status
Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions