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

pageContext does not refresh in app customizers on inline navigation #6253

Closed
netti01 opened this issue Sep 9, 2020 · 11 comments
Closed

pageContext does not refresh in app customizers on inline navigation #6253

netti01 opened this issue Sep 9, 2020 · 11 comments
Labels
area:spfx Category: SharePoint Framework (not extensions related) area:spfx-extensions Category: SharePoint Framework Extensions status:fixed-next-drop Issue planned to be fixed in an upcoming release.
Milestone

Comments

@netti01
Copy link

netti01 commented Sep 9, 2020

Category

[x ] Question

Question

We assume that based on inline navigation between modern pages and lists/libs, that there is a possible issue with refreshing the page context. This is likely not only a problem with SPFX, perhaps more a general logic bug in SPO itself ?!

This has been tested using the following app customizer template from github:
https://github.com/estruyf/appcustomizer-navigation-issues-spfx

We extended the information the app customizer delivers within the header section with additional properties like "pageItemId, listTitle..."

image

When a user does an inline navigation between a modern UI page and e.g. the SitePages library, the header displays empty properties, even if you use the standard refresh events in SPFX like:

this.context.application.navigatedEvent

This is the default output if you directly load a doc lib.
image

This is the output if you do an inline navigation from a page to the lib
image
As you can see, also the url of the lib is incorrect.

We also figured out that inline navigation to doc libs/lists causes some additional issues which may be related to this behavior, like:

  • Header placeholder element in DOM is contained twice (one from the page you navigated from, the other from the lib). Perhaps the Modern Page Header is simply outdated?

image

  • If you navigate inline from a modern page to SitePages lib, you are not able to open a modern news link in edit mode anymore (an url parameter is not set correctly - ?stay=true) > Fully reload SitePage lib (F5) and it works as expected.

Any help or tipps on how to address this issues to the right people? We allready opened support tickets for these issues on our tenant, still at first level support, and it is not easy to explain the direct user impact because the app customizer is somehow "custom development".

Thanks
Bjoern

Environment details

  • Your Developer Environment:Windows 10
  • Target Environment: SharePoint Online
  • Framework: Node.js v8
  • Browser(s): any
  • Tooling: VS Code | SPFx 1.10

Tags

#spfx-tooling #spfx

Possible related issues

#6237

@msft-github-bot
Copy link
Collaborator

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

@MrTantum
Copy link

MrTantum commented Sep 9, 2020

We have noticed this too. Could this be a general problem with url-query parameters when using inline navigation?

@estruyf
Copy link
Collaborator

estruyf commented Sep 10, 2020

There are indeed issues with partial page transitions, check the following posts for a couple of techniques to overcome this: https://www.eliostruyf.com/things-to-check-in-your-spfx-application-customizer-after-page-transitions/

@andrewconnell andrewconnell added area:spfx-extensions Category: SharePoint Framework Extensions type:question Question... if answered, will be tagged as such. and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Sep 10, 2020
@netti01
Copy link
Author

netti01 commented Sep 11, 2020

@estruyf - Thanks for your answer..

Actually we are allready using the same techniques you mentioned in your blog post to workaround this issues (like navigatedEvents, navigation history).

If nothing works, pageContext somehow did not refresh, the only thing we can do (like in your code) is to trigger a full page reload. (not based on a language check, in our case, listId, listTitle and a lot more are empty)

image

The big difference is, that this actually happens if a user navigates between a modern page and a doc lib and not like in your code, only when the user navigates between different hubs or site collections. Means: the overall inline navigation concept between pages and libs can not be used and always needs a full page reload in order to provide the correct pageContext.

@estruyf
Copy link
Collaborator

estruyf commented Sep 11, 2020

BTW, the double placeholders #4945 was already reported a long time ago. Issue is still open.

@Peter-Ross-C
Copy link

Can confirm that we are also experiencing this issue.

We are making use of an ApplicationExtension to run some code on all pages, which is now only running on full page loads/reloads.

@estruyf Will explore the options in your article, thanks for that.

@MartinWhiteDAZN
Copy link

MartinWhiteDAZN commented Oct 21, 2020

We are experiencing this as well.
It happens with the simplest test:
Scaffold a new extension and deploy it as-is.
Navigate between pages using the SharePoint navigation and the dialog only appears when the same navigation link is clicked twice.

Thank you @estruyf for pointing out this link that has provided a good work around for me: https://blog.velingeorgiev.com/page-hit-when-SPA-page-transitioning-modern-sharepoint-sites

@VesaJuvonen VesaJuvonen added the area:spfx Category: SharePoint Framework (not extensions related) label Nov 1, 2021
@coreyroth
Copy link

This is definitely still an issue for me and according to my logs, it started happening more and more starting in May for me. I see this happen across tenants thousands of times per week. I've used some of the workarounds but it's not guaranteed.

@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue planned to be fixed in an upcoming release. and removed type:question Question... if answered, will be tagged as such. labels Dec 1, 2021
@AJIXuMuK AJIXuMuK added this to the 12-02 milestone Dec 1, 2021
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Dec 1, 2021

Sorry @netti01 for the long delay.
We've fixed this issue, and the fix should be available WW in the next couple of weeks.

@patmill
Copy link
Contributor

patmill commented Jan 12, 2022

This should be WW now.

@patmill patmill closed this as completed Jan 12, 2022
@ghost
Copy link

ghost commented Jan 20, 2022

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

@ghost ghost locked as resolved and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:spfx Category: SharePoint Framework (not extensions related) area:spfx-extensions Category: SharePoint Framework Extensions status:fixed-next-drop Issue planned to be fixed in an upcoming release.
Projects
None yet
Development

No branches or pull requests