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

TypeError in input-time-zone setFocus() #10736

Closed
2 of 6 tasks
nwhittaker opened this issue Nov 15, 2024 · 2 comments
Closed
2 of 6 tasks

TypeError in input-time-zone setFocus() #10736

nwhittaker opened this issue Nov 15, 2024 · 2 comments
Assignees
Labels
1 - assigned Issues that are assigned to a sprint and a team member. 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. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.

Comments

@nwhittaker
Copy link
Contributor

Check existing issues

Actual Behavior

Encountering a consistent CI test failure where a TypeError is thrown when calling setFocus() on a <calcite-input-time-zone> element.

Expected Behavior

No TypeError and CI tests do not fail.

Reproduction Sample

https://github.com/ArcGIS/acadia-web

Reproduction Steps

The repo is private and there isn't an easy way to repro locally.

Reproduction Version

2.13.2

Relevant Info

Interestingly, failures are not reproducible when running CI tests locally (both in browser and headless) -- possibly indicating some sort of race condition.

Our tests have a helper that waits for the component to hydrate and then calls setFocus() on it before filling in a value. The stack trace shows the end of that chain after calling setFocus() on a <calcite-input-time-zone> element:

TypeError: Cannot read properties of undefined (reading 'setFocus')
    at U.setFocus (https://localhost:34029/calcite-components-2.13.2/p-f0abbe8c.entry.js:6:6800)
    …

The component's implementation forwards the setFocus call onto a combobox reference which does not appear to exist yet (or has gone away?). Either way, typing the comboboxEl property as optional would likely clear up the issue for us:

@Method()
async setFocus(): Promise<void> {
await componentFocusable(this);
await this.comboboxEl.setFocus();
}

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

A workaround is to stop calling setFocus() on the component during tests. However, this adds the risk of no longer exercising any focus-related logic.

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 Nov 15, 2024
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Nov 15, 2024
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Dec 18, 2024
@jcfranco
Copy link
Member

@nwhittaker Could you test with next? This might already be resolved by #10310.

@nwhittaker
Copy link
Contributor Author

I am no longer seeing this error in CI after upgrading to Calcite 3 -- thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - assigned Issues that are assigned to a sprint and a team member. 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. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.
Projects
None yet
Development

No branches or pull requests

3 participants