SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 998 forks source link

SPFx ListView Command Set SelectedRows length greater than zero not working #9535

Open Mike-tech opened 6 months ago

Mike-tech commented 6 months ago

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

Additional environment details

Describe the bug / error

The default code shown below is fine when you want the button to show on select item selection // This command should be hidden unless exactly one row is selected. compareOneCommand.visible = this.context.listView.selectedRows?.length === 1;

But I want the button to show when multiple items are selected which you can do in previous SPFx: compareOneCommand.visible = this.context.listView.selectedRows?.length > 0;

image

I'm using SPFx version 1.18.2

Steps to reproduce

Install default SPFx List Command Set Change above command described in bug/error

Expected behavior

SPFx should allow button to be used when more than one item is selected. Unless a limit has been placed. Is this a version issue?

ghost commented 6 months ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

AJIXuMuK commented 2 weeks ago

@Mike-tech - sorry for the long delay. There were recent changes that should have fixed some misbehavior in the extensions. Could you please check if the issue is still happening for you?

Thanks!