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

Dialog emits unexpected close event when removed in 2.14, uncaught error in 3.0 #10860

Closed
2 of 6 tasks
mpayson opened this issue Nov 24, 2024 · 3 comments
Closed
2 of 6 tasks
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Data Pipelines Issues logged by ArcGIS Data Pipelines 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 - 2 Small fix or update, may require updates to tests. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@mpayson
Copy link

mpayson commented Nov 24, 2024

Check existing issues

Actual Behavior

In 2.14, Calcite dialog emits a close event when it is removed from the DOM. It should not emit an event in this case because the app already knows it is closing the dialog, and it causes a complication at least in our app (see impact)

In 3.0, an uncaught type error is thrown in the console but an event is not emitted: Uncaught (in promise) TypeError: this.transitionEl is undefined

Expected Behavior

Calcite dialog does not emit an event when it is removed from the DOM, like in 2.13

Reproduction Sample

https://codepen.io/mpayson/pen/raBBxgG

Reproduction Steps

  1. Open the code pen and developer tools
  2. Wait 3 seconds, see dialog is removed and a close event is logged
    a. Note, you may need to load the codepen twice -- the first time the CDN assets can take longer than 3 seconds
  3. Repeat with 3.x build, see type error

Reproduction Version

2.14

Relevant Info

No response

Regression?

2.13

Priority impact

impact - p1 - need for current milestone

Impact

Our app has a guided tour UX that transitions from a modal to a popover. When this transition happens and the modal is removed, our app receives a close event, which makes it think the user closed the guided tour, and the tour unexpectedly stops

I can't think of a good work around for this. It looks like the event gets emitted after the animation completes and the dialog is removed, which makes the behavior timing-dependent. I think we would have to set a flag when the transition starts, then block the close event from closing the tour for approximately the time the animation takes to complete. Would appreciate other work around ideas though!

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 Data Pipelines

@mpayson mpayson 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 24, 2024
@github-actions github-actions bot added ArcGIS Data Pipelines Issues logged by ArcGIS Data Pipelines team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone labels Nov 24, 2024
@mpayson
Copy link
Author

mpayson commented Nov 24, 2024

Maybe related? #10666

@mpayson mpayson changed the title Dialog emits close event when removed in 2.14, uncaught error in 3.0 Dialog emits unexpected close event when removed in 2.14, uncaught error in 3.0 Nov 24, 2024
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 2 Small fix or update, may require updates to tests. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Nov 26, 2024
jcfranco pushed a commit that referenced this issue Nov 26, 2024
**Related Issue:** #10860

## Summary

- fix error when dialog is opened initially.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Nov 26, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned driskull Nov 26, 2024
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Nov 26, 2024
@geospatialem
Copy link
Member

Verified in 3.0.0-next.31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Data Pipelines Issues logged by ArcGIS Data Pipelines 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 - 2 Small fix or update, may require updates to tests. impact - p1 - need for current milestone User set priority impact status of p1 - need for current 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

5 participants