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

Popover can no longer be opened by setting open manually #11244

Open
2 of 6 tasks
tom12993 opened this issue Jan 9, 2025 · 4 comments
Open
2 of 6 tasks

Popover can no longer be opened by setting open manually #11244

tom12993 opened this issue Jan 9, 2025 · 4 comments
Assignees
Labels
3 - installed Issues that have been merged to master branch and are ready for final confirmation. ArcGIS Monitor Issues logged by ArcGIS Monitor 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 - 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

Comments

@tom12993
Copy link

tom12993 commented Jan 9, 2025

Check existing issues

Actual Behavior

Programmatically setting a calcite-popover to open not working, when auto-close is set

Expected Behavior

calcite-popover should be responsive to the open prop being set

Reproduction Sample

https://codepen.io/tom12993/pen/vEBYoBx?editors=1011

Reproduction Steps

  1. Within the codepen, click the red button and see that the popover opens
  2. Change the version from 2.6.0 to any version after that, and notice that the red button no longer works

Reproduction Version

2.13.2

Relevant Info

OS: Windows 10
Browser: Google Chrome

Regression?

2.6.0

Priority impact

impact - p2 - want for an upcoming milestone

Impact

It's breaking an existing feature on most of our pages. There is a workaround by clicking a different button, but it's not apparent to users.

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 Monitor

@tom12993 tom12993 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 Jan 9, 2025
@github-actions github-actions bot added ArcGIS Monitor Issues logged by ArcGIS Monitor 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 Jan 9, 2025
@driskull
Copy link
Member

driskull commented Jan 9, 2025

This is because the autoClose is closing the popover since the referenceElement isn't being clicked.

To workaround this, you should be able to stopPropagation on the click of the button like so:

https://codepen.io/Matt-Driscoll/pen/LEPQaOG?editors=1011

We may be able to enhance this to stop autoClose when the event is prevented. cc @jcfranco for if we want to do that.

@tom12993
Copy link
Author

To workaround this, you should be able to stopPropagation on the click of the button like so:

@driskull Thank you! That workaround looks promising. We'll give it a try

driskull added a commit that referenced this issue Jan 15, 2025
**Related Issue:** #11244

## Summary

- updates tooltip and popover to take no action on prevented events
- adds tests
- This allows users to prevent an event instead of stopping propagation
on it.
@driskull
Copy link
Member

With the next 3.0.0-next.103 or later you should be able to call event.preventDefault() on the click event instead of event.stopPropagation()

@driskull driskull added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 0 - new New issues that need assignment. labels Jan 15, 2025
Copy link
Contributor

Installed and assigned for verification.

@driskull driskull added estimate - 3 A day or two of work, likely requires updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive and removed needs triage Planning workflow - pending design/dev review. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - installed Issues that have been merged to master branch and are ready for final confirmation. ArcGIS Monitor Issues logged by ArcGIS Monitor 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 - 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
Projects
None yet
Development

No branches or pull requests

4 participants