Skip to content

SPFx ListViewCommandSet Extensions are no longer being loaded when switching list context in side navigation! #5704

@frevds

Description

@frevds

Category

  • Bug

Describe the bug

Okay, let't try that again in the right section.

I registered a ListViewCommandSet Extension for a list.
But the extension is not being loaded, if I don't directly navigate to that list:

If I open the list page for a list for which the extension is activated, the extension gets loaded (constructor called, onInit called).

If I open the list page for another list for which the extension is not activated and then navigate to the list for which it is activated, using the navigation tree, the extension does NOT get loaded.

Also, if the extension was loaded for a list and the user switches to another list using the navigation, any extension activated for that list does not get initialized (constructor or onInit is not being called again).

Finally, the onListViewUpdated-Event never worked.

This issue makes list view command set extensions quite useless and breaks our product.
Is there any fix coming for this or should we move on to generic extensions loaded for every page?

Steps to reproduce

Use the yo generator to create a new ListViewCommandSet and try on your own to get it loaded for a list if you don't directly navigate to it (in SharePoint Online), see details above.

Second problem: the onListViewUpdated-Event never fires, no matter what you do in the ListView (provided the extension was loaded at all).

Expected behavior

Extensions should be loaded for lists on which they are registered, when you navigate to the list (using the navigation). Currently they are only loaded if you directly enter the correct list when opening the browser page, not when navigating in the tree (where the page does not reload but merely React controls get rerendered). This behaviour did work before, but is now broken.

Second problem: Changes in the selection of the list view should fire the event. Maybe even changes to the list context (navigating).

Environment details (development & target environment)

  • OS: Windows 10
  • Target Environment: SharePoint Online
  • Framework: Node.js v10
  • Browser(s): Chromium Edge latest
  • Tooling: SPFx v1.10.0
  • Additional details: Suspecting latest changes in SPO, client and solution did not change

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:spfx-extensionsCategory: SharePoint Framework Extensionsstatus:fixedIssue was fixed in current or prior release.status:trackedCurrently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)type:bug-confirmedConfirmed bug, not working as designed / expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions