Add View and List information into Command Set and Field Customizer contexts
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
List and view information is available in Command Set and Field Customizer context (at least listId, viewId)
Observed Behavior
There is no way to get the information in Command Set and Field Customizer. That issue was not so critical while extensions were not available in Document Library and List web parts. But now, when we can have multiple lists per page, there is no way (even hack or workaround) to get list and view info in the extensions.
It's pretty critical for any customization that rely on additional data about list and/or view. The simplest example: Command Set is registered for both document libraries and lists. In the code I want to know the context - if the Command Set is rendered for Doc Lib, or list.
Steps to Reproduce
Look at Command Set and Field Customizer APIs.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
I totally agree.
We have several extensions to lists and libraries. When customers place the list and library webpart on a modern page there is no way for our extensions to know which list the extension is running for.
The best thing for us would be if IListViewCommandSetExecuteEventParameters could be extended with ListId and possible ViewId
The next best thing would be if this.context.pageContext.list would be updated as soon as the user interacts with a list/library webpart'.
I filed this on userVoice: https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/36938845-ilistviewcommandsetexecuteeventparameters-spfx-cur
Hello, Any updates/dates on this one? Thanks!
This is a real struggle if we use the lists relative Url as well. If running our CommandSet on the dedicated List page, this works as expected, but the relative Url of the list is lost if the CommandSet is running in a web part on a Modern Site Page.
@AJIXuMuK - Thanks for raising the concern.
Yes, that seems like an issue and we will look into this issue. However, we're currently working on other higher priority items. We will get to this one, according to its priority.
This is now being tracked internally.
Any news on this issue?
Anything to report on this issue? It has been open for nearly two years at this point.
We are discussing the long term / broad direction of this in this discussion - https://github.com/SharePoint/sp-dev-docs/discussions/7375
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