sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

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

Open SPJS opened this issue 1 year ago • 5 comments

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
  • [X] 💥 Microsoft Edge
  • [X] 💥 Google Chrome
  • [X] 💥 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.

SPJS avatar Oct 06 '24 08:10 SPJS

@SPJS thanks! I think we have a fix for this issue which is in the progress of rolling out, but I'll double-check.

reedpamsft avatar Oct 07 '24 17:10 reedpamsft

@reedpamsft Any updates on this one? - I still see the same issue and it breaks my list view command set.

Alexander

SPJS avatar Oct 08 '24 15:10 SPJS

@SPJS the fix should be available within the next week, depending on a lot of factors that are out of my control. In the meantime, this should only affect First Release users.

reedpamsft avatar Oct 08 '24 18:10 reedpamsft

@reedpamsft Thanks for the clarifications - it helps that it only affects first release users.

Alexander

SPJS avatar Oct 08 '24 19:10 SPJS

@reedpamsft I can confirm that this issue is resolved, but there is another related issue that I have filed here: https://github.com/SharePoint/sp-dev-docs/issues/9978

Alexander

SPJS avatar Oct 22 '24 17:10 SPJS

Hello @SPJS, Thank You for your patience. Is the issue resolved now?

Amey-MSFT avatar Apr 18 '25 05:04 Amey-MSFT

Hi, Yes, this works as expected now - thanks.

Alexander

SPJS avatar Apr 18 '25 15:04 SPJS