CommandSet Extensions don't work in Document Library when navigating from LHN link on site home page
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
No response
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [X] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- browser version
- MS Edge - Version 98.0.1108.50 (Official build) (64-bit)
- Chrome - Version 98.0.4758.102 (Official Build) (64-bit)
- SPFx version - 1.14 (also does not work in prior versions 1.12 and 1.13 tested)
- Node.js version - v14.17.1
Describe the bug / error
When you navigate from a modern site's home page to a document library using the OOTB left hand navigation, something does not fully load on the document library page as any custom listview extensions do not work. If you refresh the library page, then the actions work as expected.
Steps to reproduce
- Create a new SPFX extension project using the 1.14 yeoman generator, using all default values for HelloWorld listviewcommandset
- Update elements.xml to target libraries with RegistrationId=101
- Deploy to SharePoint Online and add to a modern site
- Create a document library, add a couple documents, make sure it shows in navigation
- Go to home page of site, click on the link to open the document library
- Try to click on the 'command 2' action - does not open alert box as expected
- Select one or more documents, click on the 'command 1' action - does not open alert box as expected
- Refresh page - click on the 'command 2' action - it now opens the alert box that says 'this command is always visible'
i've attached my skeleton project that was deployed to our sponline environment. spfx-14-test.zip
Expected behavior
The command set buttons should work whether you navigate from home page or land directly on a document library page.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @teresahoes - thanks for reporting this issue. I have tested your sample on multiple tenants, with default and newly created document libraries. And seems like everything is working fine. Could you please double-check if the issue is still repro on your side? Also, could you try reproducing it on another site collection?
Thanks!
Hi @AJIXuMuK -- thank you for looking into this. Yes I can reproduce on many of our site collections. I wonder if it has to do with the template they are using? I did try deploying to a Teams based site and it works correctly.
All of the site collections where it doesn't work have been around for some time and have been converted over to use modern lists and libraries. they are based on this template per the page source.
"WebTitleCurrentLCID":0,"webTemplate":"1","webTemplateConfiguration":"STS#0"
are you able to test that scenario?
@teresahoes - are you still using classic pages on these sites (not lists and libraries, but Home page, etc.)? Do you have publishing feature enabled?
Hi @AJIXuMuK
The publishing feature is turned ON in these sites, and where it doesn't work it looks like the home page is a classic page. When i try similar sites that have a modern home page then it works correctly navigating from home to the modern library.
So if that's a workaround, we can work on updating the home pages to be modern.
@teresahoes - I'll try to repro it and check if we can do something on our end. But I would definitely update to the modern pages if feasible anyway :)
great thank you so much @AJIXuMuK
Hi @teresahoes - we've found and fixed the issue. It will be rolled out WW in the next couple of weeks.
Great news thanks so much for your assistance!
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