Sp-dev-docs: ApplicationCustomizer: context.application.navigatedEvent logic

Created on 28 May 2019  路  15Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

Could you please explain the logic, how context.application.navigatedEvent is called in ApplicationCustomizer?

From what I can see:

  1. it is called when navigating between pages. For example, from one list to another. That seems correct.
  2. If you navigate between two same pages (in my cases - two lists) it stops firing. List A -> List B - fired. List B -> List A - no fired
  3. it is called when navigating between views in the same list FOR THE FIRST TIME ONLY. It seems weird.
spfx-extensions working-on-it bug-confirmed

All 15 comments

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

Seems to be the same old issue as this #3836

We are working on fixing this issue soon. Thank you for your patience.

@ahackettms please also make sure, that the pageContext of sharepoint framework is getting updated correctly. This is not the case right now when navigating between lists. Thank you!

Is there any update or idea as to when this fix may be deployed yet? Experiencing similar issues myself when navigating using quick links web part / Hub nav / sites web part to navigate to sites associated with a Hub. Many thanks.

The fix for this issue should have been deployed. Please try again. @andrewconnell
Note that the fix address the scenario of navigating between pages and lists, but doesn't address navigating into folders.

It took quite a long time, but I can confirm it is finally working! Thank you!

Great! It was actually deployed a few weeks ago.
@patmill shall we close this issue and other duplicate issues?

I didn't see it's working in my scenario. Do I need to rebuild the solution? Please provide steps to perform from my side to see the change.

Issue: Custom commands sets developed for different libraries. For the first time, these commands loading based on the library, but later it's not loading properly. The most recent library's commands are appearing for all other libraries which is not expected.

I can confirm it does not work in my scenario either. Scenario is I am on a hub site and navigate to another site via the sites webpart. Anything clickable in the footer that uses this.context still uses the context of the page I navigated away from.

As @srinutamada says, do we need to rebuild / redeploy the solution?

Hi all,

It works better.
But...

  1. Sometimes the event is fired after navigation, and sometimes before. You can check it by adding console.log(window.location.href). Sometimes you'll see the final url there, sometimes transitional url like https://tenant.sharepoint.com/sites/site/Lists/List%201/AllItems.aspx?id=%2Fsites%2Fsite%2FLists%2FList%202&newTargetListUrl=%2Fsites%2Fsite%2FLists%2FList%202&viewpath=%2Fsites%2Fsite%2FLists%2FList%202%2FAllItems%2Easpx
  2. Point 3 from the initial description is still there - when navigating between views the even is fired for the first time only.

@ahackettms people are still saying this issue is present... as such I don't think we can close this or others...

As per my ticket #5029 , the event does not fire when creating new pages from a Site Page, which means the context is not correct.

I am also able replicate #5029 , when creating a new page does not trigger the navigatedEvent.

@andrewconnell I believe #5029 is a different issue as it has never been mentioned in this issue previous to your mention of it. This issue (#4054) is very generic with specific issues being mentioned in it. This makes it really hard to tell what specific issues have been addressed by the SP team.

5029 still remains an issue for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StfBauer picture StfBauer  路  3Comments

mikeparkie picture mikeparkie  路  3Comments

nanddeepn picture nanddeepn  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

karishmaTCS picture karishmaTCS  路  3Comments