Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
269 stars 75 forks source link

CalciteTabNav throwing console.error on load #9057

Open nikki-lea opened 3 months ago

nikki-lea commented 3 months ago

Check existing issues

Actual Behavior

Console errors showing up on loading studio project

Expected Behavior

No console errors should appear

Reproduction Sample

Not reproducible outside studio

Reproduction Steps

  1. In studio, open a project and switch tabs
  2. Click the logo in the top left to navigate back to the landing page
  3. Open a project again
  4. Error may show in the console

Reproduction Version

2.7.1

Relevant Info

TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect')
    at Array.eval (tab-nav.js:323:55)
    at consume (index.js:4130:21)
    at flush (index.js:4163:5) undefined

I confirm the error stops happening if I made the following changes:

  1. Add an optional check on tabTitleContainer on lines 319 & 321 here - https://github.com/Esri/calcite-design-system/blob/main/packages/calcite-components/src/components/tab-nav/tab-nav.tsx#L319
  2. Check that containerBounds is defined in the if statements conditions on line 330 & 337 in the above file

Regression?

No response

Priority impact

p4 - not time sensitive

Impact

No response

Calcite package

Esri team

ArcGIS Enterprise

nikki-lea commented 1 month ago

Apologies for the delay @jcfranco, I met with you regarding this issue and mentioned that I would provide a test server in which the error could be reproduced - it took us a while for our version of calcite to get updated in main to where the error is now reproducible! The test server that you can use is https://etait.esri.com/portal/apps/knowledge-studio/landing, the error should show up on opening any existing project listed.