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

Setting the selected attribute on multiple chips in a single selection group on initial page load fails to work correctly and consistently #9269

Open
2 of 6 tasks
eriklharper opened this issue May 6, 2024 · 0 comments
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. 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 needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. p - low Issue is non core or affecting less that 10% of people using the library p3 - want for upcoming milestone User set priority status of p3 - want for upcoming milestone

Comments

@eriklharper
Copy link
Contributor

eriklharper commented May 6, 2024

Check existing issues

Actual Behavior

Including the selected attribute on more than one calcite-chip element in a selection-mode="single" group will sometimes highlight the first one, sometimes the second one, and sometimes the last one. Setting multiple selected chips in a single-persist selection group results in all 3 chips appearing selected.

 <calcite-chip-group label="demo-group-label" selection-mode="single" id="single-programmatic">
    <calcite-chip selected kind="inverse" value="calcite chip">Research</calcite-chip>
    <calcite-chip kind="inverse" value="calcite chip">Findings</calcite-chip>
    <calcite-chip selected kind="inverse" value="calcite chip">Hypothesis</calcite-chip>
    <calcite-chip id="chip-to-change-single" kind="inverse" value="calcite chip">Supplies</calcite-chip>
    <calcite-chip kind="inverse" value="calcite chip">Employees</calcite-chip>
  </calcite-chip-group>
Chip.Group.selects.different.chips.on.page.load.randomly.mov

Expected Behavior

According to the HTML spec for radio buttons, the last selected element in DOM order should be the selected element, similar to segmented-control.

image

Reproduction Sample

https://codepen.io/eriklharper/pen/OJGKqqZ

Reproduction Steps

  1. Open the Codepen Reproduction Sample
  2. Refresh the page over and over to observe that the last chip in the DOM order with the selected attribute in the HTML is not always the one that appears selected in the first chip group.
  3. Also observe the 2nd chip group shows all 3 chips selected when its supposed to just be the last one.

Reproduction Version

2.8.0

Relevant Info

No response

Regression?

No response

Priority impact

p3 - want for upcoming milestone

Impact

No response

Calcite package

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

Esri team

Calcite (dev)

@eriklharper eriklharper 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 May 6, 2024
@github-actions github-actions bot added p3 - want for upcoming milestone Calcite (dev) Issues logged by Calcite developers. calcite-components Issues specific to the @esri/calcite-components package. labels May 6, 2024
@geospatialem geospatialem added impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone and removed p3 - want for upcoming milestone labels May 21, 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. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels May 28, 2024
@github-actions github-actions bot added the p3 - want for upcoming milestone User set priority status of p3 - want for upcoming milestone label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. 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 needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. p - low Issue is non core or affecting less that 10% of people using the library p3 - want for upcoming milestone User set priority status of p3 - want for upcoming milestone
Projects
None yet
Development

No branches or pull requests

2 participants