Skip to content

Commit faf2e90

Browse files
committed
[People Picker] Allow to set resultsMaximumNumber
1 parent b54fda7 commit faf2e90

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/controls/peoplepicker/IPeoplePicker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export interface IPeoplePickerProps {
2828
* Name of SharePoint Group
2929
*/
3030
groupName?: string;
31+
/**
32+
* Maximum number of suggestions to show in the full suggestion list. (default: 5)
33+
*/
34+
resultsMaximumNumber?: number;
3135
/**
3236
* Selection Limit of Control
3337
*/

src/controls/peoplepicker/PeoplePickerComponent.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ import { IPersonaProps } from "office-ui-fabric-react/lib/components/Persona/Per
1717
import { MessageBarType } from "office-ui-fabric-react/lib/components/MessageBar";
1818
import { ValidationState } from 'office-ui-fabric-react/lib/components/pickers/BasePicker.types';
1919

20-
const suggestionProps: IBasePickerSuggestionsProps = {
21-
suggestionsHeaderText: 'Suggested People',
22-
noResultsFoundText: 'No results found',
23-
loadingText: 'Loading'
24-
};
25-
2620
/**
2721
* PeoplePicker component
2822
*/
@@ -367,6 +361,14 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
367361
* Default React component render method
368362
*/
369363
public render(): React.ReactElement<IPeoplePickerProps> {
364+
const suggestionProps: IBasePickerSuggestionsProps = {
365+
suggestionsHeaderText: 'Suggested People',
366+
noResultsFoundText: 'No results found',
367+
loadingText: 'Loading',
368+
resultsMaximumNumber: this.props.resultsMaximumNumber ? this.props.resultsMaximumNumber : 5
369+
};
370+
371+
370372
const peoplepicker = (
371373
<div id="people" className={`${styles.defaultClass} ${this.props.peoplePickerWPclassName ? this.props.peoplePickerWPclassName : ''}`}>
372374
<Label>{this.props.titleText || strings.peoplePickerComponentTitleText}</Label>

0 commit comments

Comments
 (0)