Closed mpayson closed 1 year ago
Note: this isn't specific to React, it repro's in the vite sample as well:
@mpayson Thanks for the excellent issue description. Installed a workaround to avoid the error, while we look into creating a repro case. Fortunately, as you pointed out, focus works as expected after the open transition.
Installed and assigned for verification.
Verified with master
.
Actual Behavior
When calling
setFocus
on calcite-modal with dist-custom-elements, the TypeError below gets thrown. The error stems fromfocusTrapEl
being undefined when focusFirstTabbable is called here, so maybe the fix from #5749 does not work with the custom-elements output type? Also, it does look likesetFocus
gets called internally here and focuses the close button as expected, so consuming apps may not need to call it?Expected Behavior
setFocus
method waits until the component has loaded and the TypeError is not thrownReproduction Sample
https://github.com/mpayson/calcite-components-examples/tree/set-focus-issue
Reproduction Steps
cd react && npm install && npm start
Reproduction Version
beta.99
Relevant Info
No response
Regression?
No response
Impact
No response
Esri team
ArcGIS Online