Closed salascz closed 2 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi salascz,
I am able to reproduce this error with the demo webpart:
I suspect this is a bug and caused by a special mechanism on Modern page : when a hyperlink is clicked, navigation to the page is achieved via a page router to avoid full refresh of the screen.
Baker Kong Microsoft SharePoint Community Support
Hi @kongmengfei, thanks for preparing a demo WebPart. I agree with your observation, the page router mechanism is probably the root cause. Seems to be OK for "standard" Modern pages and only App pages are affected.
Is there a way, how to get it fixed?
Thanks
@salascz just ran into this issue myself. Were you able to find a workaround?
@salascz just ran into this issue myself. Were you able to find a workaround?
Yes, I created two separate webparts (one for each configuration) and reference the same React component.
Not a good solution for large projects as each webpart increase the build time...
@salascz just ran into this issue myself. Were you able to find a workaround?
Yes, I created two separate webparts (one for each configuration) and reference the same React component.
Not a good solution for large projects as each webpart increase the build time...
Also kind of a cruddy solution but I just went up the dom and grabbed the site nav elements and added the data-interception=off attribute to each. Hopefully this is resolved before this comes back to bite me.
Hello @salascz - sorry for the long delay. The issue seems to be fixed by now.
Could you please check if the bug is still appearing for you?
Hello, @AJIXuMuK I am able to replicate the issue on Single WebPart App Pages using PnP Template (for page provisioning) and OOTB Image WebParts :(. Standard pages are OK I guess
Here is my xml template:
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2019/09/ProvisioningSchema" Version="1.0"
DisplayName="Issue Page Template">
<pnp:Templates>
<pnp:ProvisioningTemplate ID="IssuePageTemplate" Version="1.0" BaseSiteTemplate="SITEPAGEPUBLISHING#0" DisplayName="Issue Page"
Scope="RootSite">
<pnp:ClientSidePages>
<pnp:ClientSidePage PageName="TestPage1.aspx" Publish="true" PromoteAsNewsArticle="false" Overwrite="true" Layout="SingleWebPartAppPage" EnableComments="false"
Title="TestPage1">
<pnp:Sections>
<pnp:Section Order="1" Type="OneColumnFullWidth">
<pnp:Controls>
<!-- Image control -->
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "5fb5c954-0ed7-477d-8b12-f5a8fa0a40fc", "title": "Image", "description": "Add an image, picture or photo to your page including text overlays and ability to crop and resize images.", "dataVersion": "1.9", "properties": {"imageSourceType":2,"captionText":"","altText":"","linkUrl":"","overlayText":"","fileName":"","siteId":"{sitecollectionid}","webId":"{siteid}","listId":"{listid:Documents}","uniqueId":"b30ebc1b-6a8a-4c50-8d58-7b6cd235bf39","imgWidth":300,"imgHeight":392,"isFullWidth":true,"alignment":"Center","resizeCoefficient":1,"resizeDesiredWidth":2513,"fixAspectRatio":false}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"https://{fqdn}{site}/Shared Documents/parker-blue.png"},"links":{},"customMetadata":{"imageSource":{"siteId":"{sitecollectionid}","webId":"{siteid}","listId":"{listid:Documents}","uniqueId":"b30ebc1b-6a8a-4c50-8d58-7b6cd235bf39","imgWidth":300,"imgHeight":392}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="1" />
</pnp:Controls>
</pnp:Section>
</pnp:Sections>
</pnp:ClientSidePage>
<pnp:ClientSidePage PageName="TestPage2.aspx" Publish="true" PromoteAsNewsArticle="false" Overwrite="true" Layout="SingleWebPartAppPage" EnableComments="false"
Title="TestPage2">
<pnp:Sections>
<pnp:Section Order="1" Type="OneColumnFullWidth">
<pnp:Controls>
<!-- Image control -->
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "5fb5c954-0ed7-477d-8b12-f5a8fa0a40fc", "title": "Image", "description": "Add an image, picture or photo to your page including text overlays and ability to crop and resize images.", "dataVersion": "1.9", "properties": {"imageSourceType":2,"captionText":"","altText":"","linkUrl":"","overlayText":"","fileName":"","siteId":"{sitecollectionid}","webId":"{siteid}","listId":"{listid:Documents}","uniqueId":"b30ebc1b-6a8a-4c50-8d58-7b6cd235bf39","imgWidth":300,"imgHeight":392,"isFullWidth":true,"alignment":"Center","resizeCoefficient":1,"resizeDesiredWidth":2513,"fixAspectRatio":false}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"https://{fqdn}{site}/Shared Documents/parker-green.png"},"links":{},"customMetadata":{"imageSource":{"siteId":"{sitecollectionid}","webId":"{siteid}","listId":"{listid:Documents}","uniqueId":"b30ebc1b-6a8a-4c50-8d58-7b6cd235bf39","imgWidth":300,"imgHeight":392}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="1" />
</pnp:Controls>
</pnp:Section>
</pnp:Sections>
</pnp:ClientSidePage>
</pnp:ClientSidePages>
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>
Hi @salascz - you need to use a webpart that supports being in a single webpart app page - none of the out of the box webparts support this. If you have a custom webpart that supports the single webpart app page, and use the same process, does it work or not? Also - if you create the page manually (not using the PNP provisioning) does it work (we are unable to repro manually)?
Hi @patmill, thank you for looking into our issue. Sorry, I thought out of the box webparts are supported as it was not possible to use not configured custom webparts when creating page from template (different story)
I can confirm it does work for pages created manually.
Looks like some kind of configuration issue on our side.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Category
Describe the bug
I have a SPFx WebPart. The WebPart is placed on two Single WebPart App Pages (with different configuration for each page). Links to those pages are included to site navigation.
The WebPart is not refreshed if user click on the navigation link. (The page url and page title is updated correctly)
Steps to reproduce
The issue might be reproduced with standard WebPart (e.g. Hero)
Expected behavior
Environment details (development & target environment)