Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 9 tasks
wuxiaojun514 opened this issue Dec 11, 2024 · 13 comments
Labels
area:spfx-in-lists type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@wuxiaojun514
Copy link

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
  • 💥 Microsoft Edge
  • 💥 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 wuxiaojun514 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Dec 11, 2024
@Feets20
Copy link

Feets20 commented Dec 11, 2024

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

@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Dec 13, 2024
@VesaJuvonen
Copy link
Contributor

@reedpamsft something on the list experiences with SPFx

@VesaJuvonen VesaJuvonen added area:spfx-in-lists and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Dec 13, 2024
@reedpamsft
Copy link
Contributor

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

@reedpamsft
Copy link
Contributor

@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.

@Haiqi-Wu
Copy link

Haiqi-Wu commented Jan 2, 2025

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?

@wuxiaojun514
Copy link
Author

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.

@Haiqi-Wu
Copy link

@reedpamsft Will the fix roll out this week?

@Haiqi-Wu
Copy link

Looks like it's fixed.

@wuxiaojun514
Copy link
Author

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

@Feets20
Copy link

Feets20 commented Jan 16, 2025

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

@reedpamsft
Copy link
Contributor

reedpamsft commented Jan 16, 2025

@Feets20 unfortunately, the fix for this issue caused #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.

@Haiqi-Wu
Copy link

@reedpamsft When will the new fix roll out?

@reedpamsft
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:spfx-in-lists type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

5 participants