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

IndexTable component state "allResourcesSelected" always returns false #12622

Open
EmReedCodes opened this issue Sep 11, 2024 · 0 comments
Open
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@EmReedCodes
Copy link

EmReedCodes commented Sep 11, 2024

Summary

inside the useIndexResourceState the allResourcesSelected will always return false regardless if all are selected or not. In the default example for this component, the only use of allResourcesSelected is for the prop selectedItemsCount which also is displaying that it doesn't work by never returning "All".

<IndexTable
  selectedItemsCount={
    allResourcesSelected ? 'All' : selectedResources.length
  }
/>

It will always return just the selectedResources.length.

Expected behavior

It should return true if all of the available items in selectedResources is selected.

Actual behavior

Image

Steps to reproduce

https://codesandbox.io/p/sandbox/sxf46p

Are you using React components?

Yes

Polaris version number

13.9.0

Browser

chrome

Device

windows

@EmReedCodes EmReedCodes added Bug Something is broken and not working as intended in the system. untriaged labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

No branches or pull requests

1 participant