Skip to content

When navigating from one folder to another, the navigatedEvent doesn't fire. #4557

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

Closed
1 of 4 tasks
dhruvp29 opened this issue Aug 29, 2019 · 18 comments
Closed
1 of 4 tasks
Labels
area:spfx Category: SharePoint Framework (not extensions related) area:spfx-extensions Category: SharePoint Framework Extensions status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug-confirmed Confirmed bug, not working as designed / expected.

Comments

@dhruvp29
Copy link

dhruvp29 commented Aug 29, 2019

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

When we navigate between the folders in document library then it should fire the navigatedEvent.

Observed Behavior

I have some logic based on which folder User is in. But it fails as when I navigates between the folder the navigatedEvent is not firing.

Steps to Reproduce

Go to Root Folder add some console and then navigate to any sub folder and write the querystring in console so you can check whether the event fired or not.

Here is the code snippet.

@override
 public onInit(): Promise<void> {
    this.context.application.navigatedEvent.add(this, this._renderPlaceHolders);
   
     return Promise.resolve<void>();
 }
  private _renderPlaceHolders(): void {

  let queryParms = new UrlQueryParameterCollection(window.location.href);
   let myParm : string = decodeURIComponent(queryParms.getValue("id"));
   console.log("QUery String: " + myParm);

   console.log("HelloWorldApplicationCustomizer._renderPlaceHolders()");
   console.log(
     "Available placeholders: ",
     this.context.placeholderProvider.placeholderNames
       .map(name => PlaceholderName[name])
       .join(", ")
   );

   // Handling the top placeholder
    {
     const topPlaceholder  = this.context.placeholderProvider.tryCreateContent(
       PlaceholderName.Top,
       { onDispose: this._onDispose }
     );

     // The extension should not assume that the expected placeholder is available.
     if (!topPlaceholder) {
       console.error("The expected placeholder (Top) was not found.");
       return;
     }

     if (this.properties) {
       let topString: string = this.properties.Top;
       if (!topString) {
         topString = "(Top property was not defined.)";
       }

       if (topPlaceholder.domElement) {
         topPlaceholder.domElement.innerHTML = `
         <div class="${styles.app}">
           <div class="${styles.top}">
             <i class="ms-Icon ms-Icon--Info" aria-hidden="true"></i> ${escape(
               topString
             )}
           </div>
         </div>`;
       }
     }
   }

   // Handling the bottom placeholder
 {
   const bottomPlaceholder  = this.context.placeholderProvider.tryCreateContent(
       PlaceholderName.Bottom,
       { onDispose: this._onDispose }
     );

     // The extension should not assume that the expected placeholder is available.
     if (!bottomPlaceholder) {
       console.error("The expected placeholder (Bottom) was not found.");
       return;
     }

     if (this.properties) {
       let bottomString: string = this.properties.Bottom;
       if (!bottomString) {
         bottomString = "(Bottom property was not defined.)";
       }

       if (bottomPlaceholder.domElement) {
         bottomPlaceholder.domElement.innerHTML = `
         <div class="${styles.app}">
           <div class="${styles.bottom}">
             <i class="ms-Icon ms-Icon--Info" aria-hidden="true"></i> ${escape(
               bottomString
             )}
           </div>
         </div>`;
       }
     }
   }
 }

I already checked #1254 which states the issue if fixed but I am still facing this issue.

@msft-github-bot
Copy link
Collaborator

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

@andrewconnell
Copy link
Collaborator

Please provide all the helpful context... SharePoint environment+version, SPFx version, browsers tested, etc.

Also, what's the first issue in reference to in the post? Unclear...

@andrewconnell andrewconnell added area:spfx-extensions Category: SharePoint Framework Extensions Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Aug 29, 2019
@msft-github-bot msft-github-bot removed the Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. label Aug 29, 2019
@dhruvp29
Copy link
Author

@andrewconnell the first issue was added by mistake.
Environment details:
SharePoint Environment - SharePoint Online
Version - vti_extenderversion:SR|16.0.0.19221
SPFx Version - tried with 1.9.1 and 1.8.2 both
Browser tested - chrome

@holylander
Copy link
Contributor

If helps, I also found the same issue. I had to modify an injected header by an app customizer extension that is used when browsing through the folders of a list. I managed to troubleshoot the issue using the mutationObserver and the builtin list breadcrumb

@dhruvp29
Copy link
Author

dhruvp29 commented Sep 6, 2019

@holylander can you please provide some more details how you used the builtin list breadcrumb for troubleshooting?

@dhruvp29
Copy link
Author

dhruvp29 commented Sep 6, 2019

@andrewconnell any update on this issue?

@andrewconnell
Copy link
Collaborator

@andrewconnell andrewconnell added the Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. label Sep 22, 2019
@dhruvp29
Copy link
Author

@andrewconnell Thanks for the feedback. I will look into the references and check if it solves the issue or not.

@msft-github-bot msft-github-bot added Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. and removed Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. labels Sep 23, 2019
@andrewconnell andrewconnell added Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. and removed Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. labels Sep 23, 2019
@dhruvp29
Copy link
Author

hi @andrewconnell , I tried the URL mentioned above but none of the solution solve my issue.
In the above URL they have the solution when the user navigates between different pages but in my case it is the navigation between the folders of same document library.

@msft-github-bot msft-github-bot added Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. and removed Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. labels Sep 25, 2019
@andrewconnell
Copy link
Collaborator

Can you provide a working sample (link to public GH repo) to help repro the issue?

@andrewconnell andrewconnell added Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. Needs: Reproduce Steps Unable to reproduce issue... repros make it easier to identify if there is an issue to fix. and removed Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. labels Sep 25, 2019
@dhruvp29
Copy link
Author

Hi @andrewconnell , Here the link to the working sample.

kindly let me know if you require more information from my end.

@msft-github-bot msft-github-bot added the Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. label Sep 25, 2019
@msft-github-bot msft-github-bot removed the Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. label Sep 25, 2019
@dhruvp29
Copy link
Author

Hi @andrewconnell , Did you get a chance to look into above?

@dhruvp29
Copy link
Author

dhruvp29 commented Oct 9, 2019

Hi @andrewconnell, Is there any update on this?

@andrewconnell andrewconnell added status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug-confirmed Confirmed bug, not working as designed / expected. and removed Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. Needs: Reproduce Steps Unable to reproduce issue... repros make it easier to identify if there is an issue to fix. labels Oct 9, 2019
@andrewconnell
Copy link
Collaborator

There are multiple issues that all seem to be related (#3236, #3836, #4054, #4191, #4557)... seems MSFT is aware and is working on it...

@cmzaragoza
Copy link

Hello @andrewconnell. Do you know is there is any update regarding this issue in last SPFx 1.10 version?

@holylander
Copy link
Contributor

Hi there, as far as I know, there is no way to track the discussed navigation event.

The only effective solution is to track down the url changes during conditional page load ( no full page load ) following the guide from microsoft.

On the other hand, I have created this small spfx extension that tracks the url changes on conditional page load or sharepoint page transition, which uses the previous approach and exposes such info as a dynamic data source, maybe it could be helpful for someone else.

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

patmill commented Nov 9, 2021

(sorry - lost track of this issue with some metadata shuffle) Right - at the moment, drilling into a folder isn't handled by the navigated event. We are tracking longer term updates to customizers here - #7406 . I've added this.

@patmill patmill closed this as completed Nov 9, 2021
@ghost
Copy link

ghost commented Nov 17, 2021

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 Nov 17, 2021
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:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug-confirmed Confirmed bug, not working as designed / expected.
Projects
None yet
Development

No branches or pull requests

7 participants