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

PropertyFieldChoiceGroupWithCallout deletes properties #592

Closed
1 of 3 tasks
IRRDC opened this issue Nov 27, 2023 · 7 comments
Closed
1 of 3 tasks

PropertyFieldChoiceGroupWithCallout deletes properties #592

IRRDC opened this issue Nov 27, 2023 · 7 comments
Assignees
Labels
Milestone

Comments

@IRRDC
Copy link
Contributor

IRRDC commented Nov 27, 2023

Category

  • Enhancement
  • Bug
  • Question

Version

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

Expected / Desired Behavior / Question

In the newest version the property assigned to the PropertyFieldChoiceGroupWithCallout gets deleted when a selection gets checked.

Observed Behavior

The current value does not get selected on load (anymore). It does show up when looking at it using the PropertyPanePropertyEditor.
As soon as one of the options gets checked the whole property vanishes from the PropertyPanePropertyEditor.

Steps to Reproduce

I created a fresh SPFX webpart using yo and just added the sample codes from
https://pnp.github.io/sp-dev-fx-property-controls/controls/PropertyPanePropertyEditor/
and
https://pnp.github.io/sp-dev-fx-property-controls/controls/PropertyFieldChoiceGroupWithCallout/
I also added "choiceGroupWithCalloutValue": "Android" to the manifest.json to create a default value.

Sample code:
s1

No choice selected on load:
s2

Property exists before making a choice:
s2a

Property is gone after making a choice:
s3

@ghost
Copy link

ghost commented Nov 27, 2023

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

@ghost ghost added the Needs: Triage 🔍 label Nov 27, 2023
@IRRDC
Copy link
Contributor Author

IRRDC commented Nov 27, 2023

Also happens in the PropertyControlsTestWebPart from this repository.

@IRRDC
Copy link
Contributor Author

IRRDC commented Nov 27, 2023

One of the reasons for the bug is this change:
46edef6#diff-162be79c6bc5b46836132ba0090fc8c213f7d20933388840100ba07b547164d9
where _onChanged gets assigend to onChange which comes with 2 parameters instead of one, so changing the signature of _onChanged to include the parameter will store the result again. Strangely that doesn't fix the problem of displaying the selected choice on re-rendering yet.

    private _onChanged(ev?: React.FormEvent<HTMLElement | HTMLInputElement>, option?: IChoiceGroupOption): void {
        if (this._onChangeCallback) {
            this._onChangeCallback(this.targetProperty, option.key);
        }
    }

IRRDC added a commit to IRRDC/sp-dev-fx-property-controls that referenced this issue Nov 27, 2023
Bugfix for issue pnp#592
Switching from office-ui-fabric-react to @fluentui/react caused incompatibilities.
Choice options no longer use "checked" but "defaultSelectedKey" and onChange has two parameters instead of one.
@IRRDC
Copy link
Contributor Author

IRRDC commented Nov 29, 2023

Does an error of this severity warrant a 3.15.1 release since it renders the PropertyFieldChoiceGroupWithCallout control unusable and may destroy existing web part configurations?

@joelfmrodrigues
Copy link
Collaborator

@IRRDC many thanks for all the info, we are discussing it and will try to resolve it as soon as we have the chance. In the meantime, I suggest you keep using the previous version if possible.

@spplante
Copy link
Contributor

Noticed the same issue today, rolling back in version fixed it for now

@AJIXuMuK AJIXuMuK self-assigned this Dec 2, 2023
@AJIXuMuK AJIXuMuK modified the milestones: 3.15.0, 3.15.1 Dec 2, 2023
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Dec 2, 2023

Thanks for reporting the issue.
It has been fixed and version 3.15.1 has been release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants