Incorrect / stale context.listView on updated SharePoint List UI experience (ListView Command Set) #9908
Labels
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
When a SharePoint List is using the updated UI experience, and the list has folders enabled, the
this.context.listView
object is not kept in sync.For example,
this.context.listView.folderInfo.folderPath
property contains the initial value when the page is loaded, but is not updated when the user clicks in to folders on the list.The
this.context.listView.rows
is also stale, and only shows the items from the initial page load.We have a ListView Command Set extension which uses the folderPath property to determine where in the list the user is when they clicked the Command Set button.
This differs to the behaviour on the 'old' modern UI.
Example:
First load of the list is mainly correct i.e. empty folder path as it's the root, rows = 3
Clicking in to 'Test' folder, folder path is still empty, and we see row count of 3, rather than row count of 1
If the page is refreshed while in the 'Test' folder, the context is correct
Clicking 'My List' on the breadcrumb, then leaves the context stale and showing the values for the 'Test' folder still
Steps to reproduce
this.content.listView.folderInfo.folderPath
and addconsole.log(this.context.listView)
Expected behavior
The
listView
object should reflect the correctrows
property andfolderInfo
, as it does on the 'old' modern experience.The text was updated successfully, but these errors were encountered: