The new Microsoft Lists layout on SharePoint lists breaks ListView Command Sets, selectedRows is empty. #9907
Labels
area:spfx-in-lists
Needs: Triage 🔍
Awaiting categorization and initial review.
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
I have build several ListView Command Set that interact with selected items on a list. Recently, the new Microsoft Lists design appears to be rolling out on SharePoint lists. After this change, some of our Command Sets stopped working. When I tried it out in development it turns out that
event.selectedRows
is an empty array, so if you have a ListView Command Set that uses selected items, they no longer work.I'm talking about the new list experience in SharePoint. The following is no longer working: selecting an item and triggering a Command Set on that item:
This is that part of (boilerplate code) that stopped working:
There is a workaround
I can work around this by accessing the selectedRows through the context object:
this.context.listView.selectedRows
Steps to reproduce
Use the getting started guide
Update the
onExecute
method from the code section with the following:Expected behavior
I'd expect the selectedRows property to work correctly, as it is part of the
IListViewCommandSetExecuteEventParameters
interface.The text was updated successfully, but these errors were encountered: