aws-northstar icon indicating copy to clipboard operation
aws-northstar copied to clipboard

Updating selectedItems in Table component does not update

Open adriantadros opened this issue 7 months ago • 1 comments

Describe the bug I am using the aws-northstar Table component. I am trying to update the selected items in the table based on some state that is being controlled outside of the table component. When I update the selected state, I can see it is updated, however the table component ignores it and does not update the selected checkbox items in the table.

Note: if I swap the aws-northstar Table component for the @cloudscape-design/components Table component, it works fine.

Versions @aws-northstar/ui v1.1.13

To Reproduce CodeSandbox link to reproduce the problem

Steps to reproduce the behavior

See CodeSandbox example.

Steps to reproduce:

  1. Click on checkbox items inside the table. The "selectedItems" state updates successfully.
  2. Click on the test button.

Expected behaviour Clicking on test button should override the selectedItems state and select the 3rd component in the table.

Actual behaviour The React state for "selectedItems" is updated successfully, however the Table component ignores it and keeps the current selection.

Additional context Using the @cloudscape-design/components Table works as expected. Swap the "Table" component in the imports in the CodeSandbox to see the difference in behavior.

adriantadros avatar Jul 13 '24 04:07 adriantadros