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 should only get closed when clicking outside if the click was not initiated inside #9506

Open
2 of 6 tasks
hcampos-professional opened this issue Jun 4, 2024 · 2 comments
Labels
0 - new New issues that need assignment. ArcGIS Scene Viewer Issues logged by ArcGIS Scene Viewer team members calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive needs triage Planning workflow - pending design/dev review.

Comments

@hcampos-professional
Copy link

Check existing issues

Description

At the time of writing, the <calcite-popover auto-close> is closed when the user clicks outside of it, even if the pointer/mouse down was done inside of the popover. That makes it very easy to accidentally the popover when selecting text, in it, for example: a user presses the mouse and starts dragging to select the text, but releases the pointer outside of the popover, causing it to be closed.

This is fairly easy to work around by tracking pointerdown and mousedown and then using onCalcitePopoverBeforeClose to prevent the dialog being closed if the down events happened outside of the popover. However, it would be nicer if it was supported directly by Calcite.

Acceptance Criteria

The popover should only be automatically closed if the "full click" gesture happened outside of it.

Relevant Info

No response

Which Component

Example Use Case

This came up in the context of the SceneViewer application which sometimes uses a popover with an input inside for renaming certain things. If the user tries to select the text in the input but releases the mouse outside, the popover gets closed.

Priority impact

impact - p3 - not time sensitive

Calcite package

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

Esri team

ArcGIS Scene Viewer

@hcampos-professional hcampos-professional added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Jun 4, 2024
@github-actions github-actions bot added ArcGIS Scene Viewer Issues logged by ArcGIS Scene Viewer team members calcite-components Issues specific to the @esri/calcite-components package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Jun 4, 2024
@driskull
Copy link
Member

driskull commented Jun 7, 2024

@jcfranco I think this is a regression from #8943

We switched from pointerdown to click.

This works fine in 2.6.0 https://codepen.io/driskull/pen/QWRMjPE?editors=100

Should we move back to pointerdown?

@jcfranco
Copy link
Member

jcfranco commented Jun 7, 2024

We also need to track where the release happens since the previous behavior was prone to closing early (e.g., the popover shouldn't close if a click starts outside and ends within the popover or vice versa).

This would also apply to tooltip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Scene Viewer Issues logged by ArcGIS Scene Viewer team members calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive needs triage Planning workflow - pending design/dev review.
Projects
None yet
Development

No branches or pull requests

3 participants