pnp / sp-dev-fx-controls-react

Reusable React controls for SPFx solutions
https://pnp.github.io/sp-dev-fx-controls-react/
MIT License
380 stars 380 forks source link

People picker issue when try to search by full name but works with upn #1740

Open Igli1994 opened 5 months ago

Igli1994 commented 5 months ago

Hello i am using last version of the package but i have a problem with PeoplePicker it suggest when i search by upn but it will not suggest if i search by full name ..

ghost commented 5 months ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

github-actions[bot] commented 5 months ago

Thank you for submitting your first issue to this project.

NishkalankBezawada commented 5 months ago

Hello @Igli1994

Could you please share the code synopsis on how you have defined PeoplePicker control.

Thanks, Nishkalank

akshataggrwal commented 4 months ago

Hello @NishkalankBezawada, I am also facing the same issue. Please find below, the implementation in my code. It works fine when I try to search by upn (Akshat.agarwal) or "agarwal, akshat" but it fails to provide any results when I search for "Akshat Agarwal"

image

Thanks!

michaelmaillot commented 2 months ago

Hi @akshataggrwal & @Igli1994,

I tried on my side with the provided code snippet, without encountering any trouble, whether I search by UPN or full name (both first and last name).

May I ask to both of you to check the following:

akshataggrwal commented 2 months ago

Hi @michaelmaillot,

Upon inspecting the OOB SPO people picker field(which work correctly), it appears to be using the same API(/_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser), with the inclusion of an additional parameter called 'UseSubstrateSearch.' and that is the only difference between the two queries.

However, I've found limited documentation on this parameter.

image

Related - https://github.com/pnp/sp-dev-fx-controls-react/issues/1534

michaelmaillot commented 2 months ago

As I'm not able to repro your issue and as I agree that there's no documentation around this API, may I suggest you to run the Controls locally, udpate the searchTenant method by including this UseSubstrateSearch and test the PeoplePicker control with the ControlsTest webpart, provided in the repo.

akshataggrwal commented 1 month ago

Hi @michaelmaillot,

Apologies for the delayed response.

I tested the web part locally by including this property, and it now searches for users based on full names as well.

image

Thanks!

michaelmaillot commented 1 month ago

Hello,

FYI I've submitted a PR with the ability to enable substrate search.

akshataggrwal commented 1 month ago

Great! Thanks for the update @michaelmaillot.

Is it reasonable to expect this fix to be included in the next release?

Thanks & Regards Akshat Agarwal

michaelmaillot commented 1 month ago

We'll try to 😉