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

[Table / Table Row] Programmatically setting selected on Table Rows does not update Table's selection UI #11142

Closed
2 of 6 tasks
macandcheese opened this issue Dec 24, 2024 · 2 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. c-table Issues that pertain to the calcite-table and related components Calcite (design) Issues logged by Calcite designers. calcite-components Issues specific to the @esri/calcite-components package. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - low Issue is non core or affecting less that 10% of people using the library

Comments

@macandcheese
Copy link
Contributor

Check existing issues

Actual Behavior

When programmatically selecting or deselecting Table Rows - the Table "selection UI" will not update (the counts shown in Chips, or the "select all" icon / cell in the Table until the component is interacted with and a re-render occurs.

Expected Behavior

I'd expect the Table to update when Table Row's selected state is updated programmatically.

Reproduction Sample

https://codepen.io/mac_and_cheese/pen/mybwRNV?editors=1000

Reproduction Steps

  1. Go to Codepen.
  2. Note that items are pre-selected.
  3. Use the Button to programmatically de-select the Rows.
  4. Notice the Table Row display updates, but the Table "count chips" and "selection icon / cell" do not.
  5. Uncomment the workaround
  6. Use the button again to see expected behavior.

Reproduction Version

2.13.2

Relevant Info

No response

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

A workaround is to "reset" the selectionMode property programmatically which will cause a re-render, and the counts and display to update correctly.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

Calcite (design)

@macandcheese macandcheese added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Dec 24, 2024
@github-actions github-actions bot added Calcite (design) Issues logged by Calcite designers. calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Dec 24, 2024
@macandcheese macandcheese added the c-table Issues that pertain to the calcite-table and related components label Dec 24, 2024
@geospatialem geospatialem added p - low Issue is non core or affecting less that 10% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. and removed needs triage Planning workflow - pending design/dev review. labels Jan 6, 2025
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jan 6, 2025
@macandcheese macandcheese added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jan 8, 2025
macandcheese added a commit that referenced this issue Jan 9, 2025
…ior (#11237)

**Related Issue:** #11142 

## Summary
Adds a private event that allows us to update the Table's
`selectedItems` and displayed selection UI when Table Rows are
programmatically selected or de-selected, without emitting a public
event. Adds local demo and test. Also updates an incorrect private
function name within the Table component.
@macandcheese macandcheese added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Installed and assigned for verification.

@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned macandcheese Jan 9, 2025
@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jan 9, 2025
@geospatialem
Copy link
Member

Verified on the dev branch

verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. c-table Issues that pertain to the calcite-table and related components Calcite (design) Issues logged by Calcite designers. calcite-components Issues specific to the @esri/calcite-components package. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - low Issue is non core or affecting less that 10% of people using the library
Projects
None yet
Development

No branches or pull requests

3 participants