pnp / pnp/sp-dev-fx-controls-react

Disable/Enable Dynamic form based on property does not work as expected

Open
#1,856 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted type:bug
Dominant language
TypeScript
Stars
433
Forks
418
Avg merge
5d 6m
Merged PRs (30d)
19

Description

[ ] Enhancement

[ ] Bug
Disable/enable Dynamic form does not work as expected when I pass the value as props.

[ ] Question

Version

Please specify what version of the library you are using: [
"@pnp/spfx-controls-react": "3.18.1",
"@pnp/spfx-property-controls": "3.17.1", ]

Expected / Desired Behavior / Question

I have a dialog component which have a dynamic form there:
Dynamic form

I am trying to use the "Edit" button to edit the value of this.props.viewModel. The value does get updated.(See the picture as below.)
debug dynamic form

I am expecting the dynamic form should be editable. But it does not get refreshed, all fields are still disabled. Could you please help to check and suggest if there's any way around?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dynamic form entry point and reproduce the dialog scenario using @pnp/spfx-controls-react 3.18.1 and @pnp/spfx-property-controls 3.17.1. Trace how the updated props.viewModel reaches the form after selecting Edit. Done means the form refreshes and its fields become editable when the property changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.