pnp / pnp/sp-dev-fx-controls-react
Request: rerender WebPartTitle when title value changes
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
I searched but I could not find a request like this. If the requested functionality is already there please guide me how to implement it in a SPFX webpart.
Category
[x] Enhancement
[ ] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 3.21.0 ]
Expected / Desired Behavior / Question
If I want to provide the user to change the webpart title via the PnP Control and via webpart settings then when changed in the settings it wont reflect in the PnP Control. Would be nice if the changes would sync immediately.
Observed Behavior
I can change the title in the webpart settings and the changes are not reflected in the control
Steps to Reproduce
Create a simple SPFX Webpart and add a PropertyPaneTextField for a title property and the WebPartTitle PnP Control. Then change the title and see if the changes are in sync. Syncing changes to the property pane can be done via something like the following example code. But not the other way around.
/*
* Method is used by the PnP WebPartTitle Component as value for "updateProperty"
*/
private saveTitle(title?: string): void {
update(this.properties, "title", () => {
return title;
});
//Update the property pane to reflect changes
this.context.propertyPane.refresh();
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WebPartTitle PnP Control and the SPFx property-pane behavior described in the reproduction steps. Reproduce the mismatch using a PropertyPaneTextField and a title property, then verify that changing the title in webpart settings immediately updates the control.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100