Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[People Picker] Allow to set resultsMaximumNumber #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/controls/peoplepicker/IPeoplePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export interface IPeoplePickerProps {
* Name of SharePoint Group
*/
groupName?: string;
/**
* Maximum number of suggestions to show in the full suggestion list. (default: 5)
*/
resultsMaximumNumber?: number;
/**
* Selection Limit of Control
*/
Expand Down
14 changes: 8 additions & 6 deletions src/controls/peoplepicker/PeoplePickerComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ import { IPersonaProps } from "office-ui-fabric-react/lib/components/Persona/Per
import { MessageBarType } from "office-ui-fabric-react/lib/components/MessageBar";
import { ValidationState } from 'office-ui-fabric-react/lib/components/pickers/BasePicker.types';

const suggestionProps: IBasePickerSuggestionsProps = {
suggestionsHeaderText: 'Suggested People',
noResultsFoundText: 'No results found',
loadingText: 'Loading'
};

/**
* PeoplePicker component
*/
Expand Down Expand Up @@ -367,6 +361,14 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
* Default React component render method
*/
public render(): React.ReactElement<IPeoplePickerProps> {
const suggestionProps: IBasePickerSuggestionsProps = {
suggestionsHeaderText: 'Suggested People',
noResultsFoundText: 'No results found',
loadingText: 'Loading',
resultsMaximumNumber: this.props.resultsMaximumNumber ? this.props.resultsMaximumNumber : 5
};


const peoplepicker = (
<div id="people" className={`${styles.defaultClass} ${this.props.peoplePickerWPclassName ? this.props.peoplePickerWPclassName : ''}`}>
<Label>{this.props.titleText || strings.peoplePickerComponentTitleText}</Label>
Expand Down