Skip to content

Incorrect context.listView.list when navigating to another list using quick launch menu (ListView Command Set) #9953

@SPJS

Description

@SPJS

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • Chrome: Version 129.0.6668.90 (Official Build) (64-bit)
  • Edge: Version 129.0.2792.79 (Official build) (64-bit)
  • SPFx version: 1.17.4

Describe the bug / error

When a SharePoint list is using the updated UI experience the this.context.listView object is not updated when you navigate to another list using the quick launch menu.

Initial page load with List_A and click on Command Two button:
image

Changed to List_B and clicked the Command Two button:
image

Steps to reproduce

  1. Create the default hello-world Command Set SPFx: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api
  2. Change the Dialog.alert for “COMMAND_2” to output this.context.listView.list.title and add console.log(this.context.listView.list)
  3. Open a list view and click the “Command Two” button. You should see the correct information.
  4. Navigate to another list in the same site using the quick launch menu.
  5. Click the “Command Two” button and it will show the previous list title in the dialog and log the other list context to the console.
  6. Refresh the page while in the new list view and the context will be correct.

Changed alert and added console.log in hello-world command set extension
image

Expected behavior

The context object should reflect the list currently shown in the browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍Awaiting categorization and initial review.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions