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

[Chip] setting "selected" before render() throws an error #10434

Closed
2 of 6 tasks
maxpatiiuk opened this issue Sep 29, 2024 · 2 comments
Closed
2 of 6 tasks

[Chip] setting "selected" before render() throws an error #10434

maxpatiiuk opened this issue Sep 29, 2024 · 2 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. estimate - 3 A day or two of work, likely requires updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive

Comments

@maxpatiiuk
Copy link
Member

Check existing issues

Actual Behavior

If you set "component.selected=true" prop before calcite-chip component had it's render(), an exception will be throw here because this.parentChipGroup is still undefined:

const selectedInParent = this.parentChipGroup.selectedItems.includes(this.el);

@arcgis_lumina.js?v=5b61032f:800 TypeError: Cannot read properties of undefined (reading 'selectedItems')
    at Chip.handleSelectionPropertyChange (chip.tsx:291:51)
    at Chip.watchSelected (chip.tsx:228:10)
    at Chip.willUpdate (chip.tsx:203:12)
    at Chip.performUpdate (chunk-RYXVTR77.js?v=5b61032f:656:14)
    at Chip._load (@arcgis_lumina.js?v=5b61032f:843:10)

Expected Behavior

There should not be an exception

Reproduction Sample

https://codepen.io/maxpatiiuk/pen/xxvwwRE?editors=1010

Reproduction Steps

  1. Set .selectionMode to something other than "none".
  2. Set .selected=true property or a calcite-chip after component's constructor() triggered but before render().
  3. See exception in the console.

Reproduction Version

2.13.0

Relevant Info

No response

Regression?

No response

Priority impact

impact - p3 - not time sensitive

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

ArcGIS Maps SDK for JavaScript

@maxpatiiuk maxpatiiuk 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 Sep 29, 2024
@github-actions github-actions bot added ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Sep 29, 2024
@jcfranco jcfranco self-assigned this Sep 30, 2024
@jcfranco jcfranco added 1 - assigned Issues that are assigned to a sprint and a team member. estimate - 3 A day or two of work, likely requires updates to tests. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Sep 30, 2024
@jcfranco jcfranco added this to the 2024-10-29 - Oct Milestone milestone Sep 30, 2024
@Esri Esri deleted a comment Oct 23, 2024
jcfranco added a commit that referenced this issue Nov 15, 2024
**Related Issue:** #10310, #10481, #10399, #10405, #10491, #10434,
#10495, #9260

## Noteworthy changes

* components are now Lit-based
* removed `@storybook/test` and `@storybook/addon-interactions` as these
were not being actively used
* React deps bumped to v18
* Added default `scale` value to:
  * `action-bar`
  * `action-group`
  * `action-menu`
  * `action-pad`
* Path of extras will change to the following:
* `/dist/extras/vscode-data.json` ➡️
`/dist/docs/vscode.html-custom-data.json`
* backwards-compatible version is preserved to not break Intellisense
[described in the
doc](https://developers.arcgis.com/calcite-design-system/resources/frameworks/#visual-studio-intellisense)
	* `/dist/extras/docs-json.json` ➡️ `/dist/docs/docs.json` (internal)
* `/dist/extras/translations-json.json` ➡️
`/dist/docs/translations.json` (internal)
	* `/dist/extras/docs-json.d.ts` ❌ (removed, internal)

BREAKING CHANGE: 

* for a consistent development experience, components now convert `null`
to `undefined`, so developers will need to update code with strict null
checks
* removed the following `@esri/eslint-plugin-calcite-components` rules
as they are no longer valid:
	* `ban-props-on-host`
	* `enforce-ref-last-prop`
	* `require-event-emitter-type`

---------

Co-authored-by: JC Franco <[email protected]>
Co-authored-by: Ben Elan <[email protected]>
Co-authored-by: Calcite Admin <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Nov 15, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Nov 15, 2024
Copy link
Contributor

Installed and assigned for verification.

@DitwanP
Copy link
Contributor

DitwanP commented Nov 16, 2024

🍡 Verified on 3.0.0-next.11

@DitwanP DitwanP closed this as completed Nov 16, 2024
@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 Nov 18, 2024
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. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. estimate - 3 A day or two of work, likely requires updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive
Projects
None yet
Development

No branches or pull requests

4 participants