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

TextArea.getHeightAndWidthOfElements sometimes throws TypeError #11514

Open
2 of 6 tasks
nwhittaker opened this issue Feb 11, 2025 · 2 comments
Open
2 of 6 tasks

TextArea.getHeightAndWidthOfElements sometimes throws TypeError #11514

nwhittaker opened this issue Feb 11, 2025 · 2 comments
Assignees
Labels
2 - in development Issues that are actively being worked on. 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. 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 - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@nwhittaker
Copy link
Contributor

nwhittaker commented Feb 11, 2025

Check existing issues

Actual Behavior

Removing a <calcite-text-area> element before it's done loading can cause its getHeightAndWidthOfElements() method to throw a TypeError.

Expected Behavior

Removing a <calcite-text-area> element before it's done loading does not produce a TypeError.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/PwooKVN

Reproduction Steps

  1. Visit the repro and open devtools
  2. Double click the Toggle block switch. If done quickly enough, the TypeError should appear in the console.
  3. To retry step 2, be sure to refresh the page first to flush any component cache.

Reproduction Version

3.0.0

Relevant Info

Stack trace

TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect')
    at x.getHeightAndWidthOfElements (XBZLGRRI.js:4:9752)
    at x.setTextAreaHeight (XBZLGRRI.js:4:9599)
    at x.updated (XBZLGRRI.js:4:8459)
    at x._$AE (KVSCG5E3.js:6:11661)
    at x.performUpdate (KVSCG5E3.js:6:11525)
    at x._load (KVSCG5E3.js:6:21372)

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

In our list/detail layouts, the end-user can generate this error by double-clicking a list item. Our automated tests are also impacted as they're more likely to discard elements before the elements are done loading/hydrating.

Calcite package

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

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Feb 11, 2025
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Feb 11, 2025
@DitwanP DitwanP added p - medium Issue is non core or affecting less that 60% 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 Feb 18, 2025
@DitwanP
Copy link
Contributor

DitwanP commented Feb 18, 2025

Note for milestone planning, we should tackle this one soon.

@DitwanP DitwanP added p - high Issue should be addressed in the current milestone, impacts component or core functionality and removed p - medium Issue is non core or affecting less that 60% of people using the library needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. labels Feb 20, 2025
@jcfranco jcfranco self-assigned this Feb 25, 2025
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Feb 25, 2025
@jcfranco
Copy link
Member

jcfranco commented Feb 27, 2025

Quick update: this might be related to a Lumina bug (see repro case). I’ll submit a workaround PR while that’s being looked into, in case it doesn’t make it into this release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - in development Issues that are actively being worked on. 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. 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 - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

3 participants