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

[SPFX ListCommandSet] _onListViewStateChanged event will never trigger if it is in grouped list view and this group has only one item

Open wuxiaojun514 opened this issue 1 year ago • 20 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

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
  • SPFx 1.19 version (I tried to create a helloworld list commandset with 1.20, it never load in new list UI...)
  • Node.js version
  • etc

Describe the bug / error

I guess this issue maybe related with #9944

We have a spfx list command set with a customized button Like this screenshot image

This week we suddenly find it doesn't work (button doesn't show) in grouped list view when there is only one item in this group image For example, if there is only one pending item in "Approve/Reject" view, then our customized button will never appear.

I debugged the code and find _onListViewStateChanged event will never trigger if there is only one row in group on grouped list view. image

I saw there is closed similar issue #7794 but that one is not for new list UI.

Steps to reproduce

  1. Create a list view commandset extension as https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api said (why this sample page still use the deprecated public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void method as example?)
  2. Run this spfx extension on a list which has grouped list view (You can just enable approval on this list, then you will get "approve/reject items" view which group by approval status
  3. You will find that the "Command One" button will never appear if you have only item in the group

Expected behavior

The _onListViewStateChanged event in List View CommandSet Extension should work as expected in grouped list view

wuxiaojun514 avatar Dec 11 '24 07:12 wuxiaojun514

We're seeing issues with this as well. This seemed to be fixed / working for a while and then noticed this week it stopped working

Feets20 avatar Dec 11 '24 20:12 Feets20

@reedpamsft something on the list experiences with SPFx

VesaJuvonen avatar Dec 13 '24 14:12 VesaJuvonen

@VesaJuvonen @wuxiaojun514 @Feets20 thanks! Feets20 reported this on the other thread and we're looking into it.

reedpamsft avatar Dec 13 '24 15:12 reedpamsft

@VesaJuvonen @wuxiaojun514 @Feets20 we have a fix for this which will roll out with new client builds in January; eta the week of the 13th. Emphasis on "estimated", though. The first build of a new year is often delayed.

reedpamsft avatar Dec 18 '24 17:12 reedpamsft

I'm facing a similar issue, with a slight difference that when I go to the list page, expand the group, and check the item for the first time it doesn't trigger the listViewStateChangedEvent, this is the first case; in the second case, when I go to the page, expand the group, and check all the items under the group through the multi-checkboxes in the group it doesn't trigger the listViewStateChangedEvent. image image

And we use SharePoint Online, which is operated by 21v. Will the roll out fix the issue I'm facing?

Haiqi-Wu avatar Jan 02 '25 06:01 Haiqi-Wu

Hi @Haiqi-Wu , I have the same experience for the first case you found, it won't trigger the event in grouped by view until you choose item again. I remembered this behavior occurs long time ago.

wuxiaojun514 avatar Jan 03 '25 01:01 wuxiaojun514

@reedpamsft Will the fix roll out this week?

Haiqi-Wu avatar Jan 14 '25 01:01 Haiqi-Wu

Looks like it's fixed.

Haiqi-Wu avatar Jan 15 '25 02:01 Haiqi-Wu

Yes, it works for me now. Many thanks! I will close this ticket.

wuxiaojun514 avatar Jan 15 '25 03:01 wuxiaojun514

@reedpamsft Was anything rolled back recently? I saw this was working fine yesterday and today it appears to be behaving how it did before

Feets20 avatar Jan 16 '25 16:01 Feets20

@Feets20 unfortunately, the fix for this issue caused https://github.com/SharePoint/sp-dev-docs/issues/10074 . We pushed a configuration change to turn off this fix, and Natalie's working on redoing this fix so that it doesn't also break that scenario.

reedpamsft avatar Jan 16 '25 16:01 reedpamsft

@reedpamsft When will the new fix roll out?

Haiqi-Wu avatar Jan 20 '25 02:01 Haiqi-Wu

@Haiqi-Wu no ETA to share yet, sorry.

reedpamsft avatar Jan 21 '25 16:01 reedpamsft

Hi.

This issue is still reproducible at the end of March 2025! Any news about a fix?

vlad-nvs avatar Mar 31 '25 11:03 vlad-nvs

Thanks for your patience here, sorry for the delay! We had two attempted fixes for this grouped view bug, but had to roll back because it seemed to cause some other issues. I'm looking into a new fix and will post updates here.

natalieethell avatar Apr 01 '25 16:04 natalieethell

We have the same problem. Can we reopen the issue if it's not fixed ? Are there any known work-arounds ?

PKOITC avatar Apr 10 '25 11:04 PKOITC

@PKOITC I reopened it. Currently my work around is to avoid using group by in the view.

wuxiaojun514 avatar Apr 11 '25 01:04 wuxiaojun514

@natalieethell Is there any progress on this?

This current behavior can be quite confusing. For example, when we have a group with two files and the used selects the files one by one. The first select triggers the event, but the second selects the whole group and doesn't trigger the event. So our extension sees only a single file selected, while the user selected multiple.

RoelVB avatar Apr 30 '25 07:04 RoelVB

There was a change rolled out recently that should fix this issue. @RoelVB @wuxiaojun514 can you confirm?

natalieethell avatar May 12 '25 22:05 natalieethell

Hi @natalieethell It looks fine now, thanks for the hotfix, I will close it

wuxiaojun514 avatar May 13 '25 01:05 wuxiaojun514