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

PeoplePickerComponent doesn't work properly if try to add one more user #128

Closed
prokach opened this issue Sep 13, 2018 · 1 comment
Closed

Comments

@prokach
Copy link
Contributor

prokach commented Sep 13, 2018

Category

[ ] Enhancement

[ X ] Bug

[ ] Question

Version [ v.1.8.0 ]

Expected / Desired Behavior / Question

When I select some user in PeoplePicker and trying to find another one in order to add one more user, a suggestion list is empty instead of showing a list of users which are related to what I've started to type.

Observed Behavior

The suggestion list always has to contain a number of users which have the same email/name(or ever role) that I started to type - started to find

Steps to Reproduce

  1. Click on user field area
  2. Type name or email of user1
  3. Select the user from a suggestion list
  4. Click on user field area again
  5. Type name or email of user2
    The suggestions list is empty

Submission Guidelines

It looks like, that the issue occurs because _listContainsPersona function which is using for filtering of suggestion list works with primaryText propery, but the items of users don't have this property(see for example on creation of a user item in _thisLoadUsers function)

primaryText properties here are undefined

  private _listContainsPersona = (persona: IPersonaProps, personas: IPersonaProps[]): boolean => {
    if (!personas || !personas.length || personas.length === 0) {
      return false;
    }
    return personas.filter(item => item.primaryText === persona.primaryText).length > 0;
  }

It's a peace of _thisLoadUsers function. Here is no primaryText defined

         userValuesArray.push({
              id: item.Id.toString(),
              imageUrl: this.generateUserPhotoLink(item.Email),
              imageInitials: "",
              text: item.Title, // name
              secondaryText: item.Email, // email
              tertiaryText: "", // status
              optionalText: "" // anything
          });

Thanks!

@prokach
Copy link
Contributor Author

prokach commented Sep 14, 2018

Thank you, @gautamdsheth

@prokach prokach closed this as completed Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant