Skip to content

DynamicForm Bug with PeoplePicker (one person) #1970

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

Open
bteddersf opened this issue Mar 28, 2025 · 1 comment
Open

DynamicForm Bug with PeoplePicker (one person) #1970

bteddersf opened this issue Mar 28, 2025 · 1 comment

Comments

@bteddersf
Copy link

Category

[ ] Enhancement

[ X] Bug

[ ] Question

Version

Please specify what version of the library you are using: [3.20 ]

Expected / Desired Behavior / Question

Observed Behavior

When using DynamicForm's fieldOverrides with a PeoplePicker control with when you save the record the user field will remain blank. There are no errors thrown. The issue is when calling the onChanged event in the switch case 0 block the line
if (!(newValue[0].id === undefined || parseInt(newValue[0].id, 10).toString() === "NaN")) return [3 /break/, 2];
will result in not(false) = true when a user is populated which will return [3 /break/, 2] therefore leaving the user blank when saved.

Image

I changed the line to this
if (newValue[0].id === undefined || parseInt(newValue[0].id, 10).toString() === "NaN") return [3 /break/, 2];
which resolved the issue and now the user is saved.

Steps to Reproduce

  1. Make sure your list has a User field for one person only.
  2. Create a SPFx Form Customizer extension solution using REACT.
  3. Install @pnp/spfx-controls-react
  4. Use the DynamicForm control and use fieldOverrides to create your own PeoplePicker control (personSelectionLimit=1).
  5. Deploy or run in workbench and enter a user and click Save. The form will save but the User field will be blank.
Copy link

Thank you for submitting your first issue to this project.

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