TypeError
in dropdown-group
when disconnected early
#10028
Labels
4 - verified
Issues that have been released and confirmed resolved.
ArcGIS Field Apps
Issues logged by ArcGIS Field Apps 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 - p2 - want for an upcoming milestone
User set priority impact status of p2 - want for an upcoming milestone
p - medium
Issue is non core or affecting less that 60% of people using the library
Milestone
Check existing issues
Actual Behavior
If a
<calcite-dropdown-group>
is removed from the DOM before it's done loading, it can throw aTypeError: Cannot read properties of null (reading 'querySelectorAll')
.Expected Behavior
It does not throw an error.
Reproduction Sample
https://codepen.io/nwhittaker-esri/pen/zYVdgqQ
Reproduction Steps
TypeError
log appears in the consoleReproduction Version
2.11.1
Relevant Info
Stack trace:
I suspect treating
this.el.parentElement
here as optional would be sufficient:calcite-design-system/packages/calcite-components/src/components/dropdown-group/dropdown-group.tsx
Line 166 in 59c91c9
Regression?
No response
Priority impact
impact - p2 - want for an upcoming milestone
Impact
The impact is largely with adding complexity to writing automated tests. In cases where the component is rendered as part of an acceptance test, its presence may not be important. However, the test still needs to wait for it to hydrate before performing an action that has the side-effect of removing the component.
Calcite package
Esri team
ArcGIS Field Apps
The text was updated successfully, but these errors were encountered: