Skip to content

03-listviewcommandset Fails to add COMMANDs and fire onInit() #89

@Mazecreator

Description

@Mazecreator

I was having problems with several SPFx Extentions with ListViewCommandSet type where the onInit() wouldn't fire. After spending a long time trying to debug, make sure IDs match, etc and rebuilding new scripts with Yeoman, I found this training sample.

Digging deeper and reviewing some other peoples experiences it seems like adding commands to the commandbar in the Extension will work under very non-user friendly conditions which will not work as a product, you need to directly link to the page (some rumor you have to use classical list view), if you go off of that page to another page and return you have the same issues again.

The best way to test this is to:

  • build the 03-liverviewcommandset
  • configure serve.json to point to a single library page with 3 or more documents in it
  • use "gulp serve" to start the process
  • After loading you will need to do a ctrl-F5 to flush the buffer and wake up the system at times
  • You should be able to see the buttons in the commandbar based upon the demo logic
  • navagate away to the "Site contents" or something and then return and you will see that the buttons no longer appear on the commandbar

NOTE: No errors show in the console related to the failed addition to the commandbar or the extension failing, it is quiet failure as best I can tell.

(Related link from Webpart: SharePoint/sp-dev-docs#10077)

Failing example:
https://github.com/SharePoint/sp-dev-training-spfx-extensions/tree/master/Demos/03-listviewcommandset

I am hoping someone else can try this example to help confirm the problem. I don't mind bringing the bug somewhere else as I don't think this is a problem with this DEMO, but with the underlying framework, I just don't know where to bring it from here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions