Sp-dev-fx-controls-react: People Picker OnChange event is missing in SPFX for SharePoint 2019

Created on 23 Jan 2021  路  4Comments  路  Source: pnp/sp-dev-fx-controls-react

Category

  • [ ] Enhancement
  • [ ] Bug
  • [X] Question

    Version

All Versions

Expected / Desired Behavior / Question

I don't understand but if I create an SPFX project which is used only for SharePoint 2019 the onChnage event is missing and there is only some event called selectedItems . The problem is I do not have any documentation. I do not know what version of PNP React Controls is used for SharePoint 2019. Hmm...Is somewhere documentation for that or some information why is this so?

Observed Behavior

OnChange event is missing.

Steps to Reproduce

  1. Create SPFX project for SharePoint 2019
  2. Use PeoplePicker in tsx file
  3. Use OnChange in deffintion
  4. You get this error
    Type '{ context: WebPartContext; personSelectionLimit: number; groupName: string; principalTypes: PrincipalType.User[]; selectedItems: (items: any[]) => void; onChange: (items: any[]) => void; resolveDelay: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<...>'.
    Property 'onChange' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<...>'.
answered question

All 4 comments

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

Since you're on on-prem I'm assuming you're using v. 1.x

From the migration guide for the 2.x release:

selectedItems is renamed to onChange

https://pnp.github.io/sp-dev-fx-controls-react/guides/migrate-from-v1/#peoplepicker

Thank you for this link. Right now I understand this. Thank you.

PS: Only there is a small problem that disabled functionality starts to work from version 2.0 which can not be used on on-premises:(

Hi @enti333.
Thank you for the question.

As @Tanddant mentioned, the property has been renamed. So, the documentation shows renamed property.
We probably need to do a better job and include docs for v1.

Regarding disabled. Unfortunately, this one will not appear for v1 and on-prem. The issue was related to the internal bug in Office UI Fabric.
It has been fixed in v6 of OUIFR. But SharePoint on-prem supports SPFx v1.4 and, as a result, OUIFR v5.
So, we can't update controls lib for on premise to use v6 of OUIFR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

estruyf picture estruyf  路  6Comments

AdiuTankT72 picture AdiuTankT72  路  4Comments

thespooler picture thespooler  路  6Comments

rabwill picture rabwill  路  4Comments

bva999 picture bva999  路  5Comments