Incorrect context.listView.list when navigating to another list using quick launch menu (ListView Command Set)
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:
Changed to List_B and clicked the Command Two button:
Steps to reproduce
- 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
- Change the Dialog.alert for “COMMAND_2” to output this.context.listView.list.title and add console.log(this.context.listView.list)
- Open a list view and click the “Command Two” button. You should see the correct information.
- Navigate to another list in the same site using the quick launch menu.
- 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.
- 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
Expected behavior
The context object should reflect the list currently shown in the browser.
@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 Any updates on this one? - I still see the same issue and it breaks my list view command set.
Alexander
@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 Thanks for the clarifications - it helps that it only affects first release users.
Alexander
@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
Hello @SPJS, Thank You for your patience. Is the issue resolved now?
Hi, Yes, this works as expected now - thanks.
Alexander