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

selectedRows is null on initial run of _onListViewStateChanged #10100

Open
1 of 9 tasks
Tanddant opened this issue Feb 4, 2025 · 0 comments
Open
1 of 9 tasks

selectedRows is null on initial run of _onListViewStateChanged #10100

Tanddant opened this issue Feb 4, 2025 · 0 comments
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@Tanddant
Copy link
Contributor

Tanddant commented Feb 4, 2025

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

  • 💥 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

  • Edge Version 132.0.2957.140
  • SPFx version 1.20.0
  • Node.js version 18.17.1
  • "New modern", "Post modern", "New new" - or whatever you want to call the new list layout

Describe the bug / error

I'm building a List View Command Set extension

When the page is loaded my, and my _onListViewStateChanged(....) function is run for the first time, the this.context.listView.selefctedRows is undefined, rather than an empty array, this change seemingly happened over night.

Steps to reproduce

Once you create a new List View Command Set extension the _onListViewStateChanged is added automatically, flip the logic as such: compareOneCommand.visible = this.context.listView.selectedRows.length === 0 and you should observe the behaviour

Expected behavior

this.context.listView.selectedRows should be an empty array if no rows are selected, even upon the first run.

@Tanddant Tanddant added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant