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

CommandSet Extensions don't work in Document Library when navigating from LHN link on site home page

Open teresahoes opened this issue 4 years ago • 10 comments

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

  1. Create a new SPFX extension project using the 1.14 yeoman generator, using all default values for HelloWorld listviewcommandset
  2. Update elements.xml to target libraries with RegistrationId=101
  3. Deploy to SharePoint Online and add to a modern site
  4. Create a document library, add a couple documents, make sure it shows in navigation
  5. Go to home page of site, click on the link to open the document library
  6. Try to click on the 'command 2' action - does not open alert box as expected
  7. Select one or more documents, click on the 'command 1' action - does not open alert box as expected
  8. 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.

teresahoes avatar Feb 21 '22 20:02 teresahoes

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Feb 21 '22 20:02 ghost

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!

AJIXuMuK avatar Feb 28 '22 16:02 AJIXuMuK

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 avatar Feb 28 '22 16:02 teresahoes

@teresahoes - are you still using classic pages on these sites (not lists and libraries, but Home page, etc.)? Do you have publishing feature enabled?

AJIXuMuK avatar Feb 28 '22 16:02 AJIXuMuK

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 avatar Feb 28 '22 16:02 teresahoes

@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 :)

AJIXuMuK avatar Feb 28 '22 16:02 AJIXuMuK

great thank you so much @AJIXuMuK

teresahoes avatar Feb 28 '22 17:02 teresahoes

Hi @teresahoes - we've found and fixed the issue. It will be rolled out WW in the next couple of weeks.

AJIXuMuK avatar Mar 02 '22 15:03 AJIXuMuK

Great news thanks so much for your assistance!

teresahoes avatar Mar 02 '22 16:03 teresahoes

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

ghost avatar Mar 09 '22 18:03 ghost