sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

Request: rerender WebPartTitle when title value changes

Open diabhoil opened this issue 9 months ago • 0 comments

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();
  }

diabhoil avatar Jun 24 '25 07:06 diabhoil