calcite-design-system icon indicating copy to clipboard operation
calcite-design-system copied to clipboard

UI that cancels `click` events prevents popovers from auto-closing

Open nwhittaker opened this issue 10 months ago • 6 comments

Check existing issues

Actual Behavior

Given a popover with auto-close enabled, clicking an element that prevents propagation of the click event causes the popover to remain open.

Expected Behavior

Clicking an element that prevents propagation of the click event does not cause the popover to remain open.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/MWRvPzQ

Reproduction Steps

  1. Visit the repro sample and click the Layer information button to open the popover.
  2. With the popover still open, click the Button with event cancelation button and observe the popover remains opened.
  3. Optionally click a blank area in the document body and see the popover closes.

Reproduction Version

2.7.0

Relevant Info

Possibly regressed by https://github.com/Esri/calcite-design-system/pull/8983. Is it possible to restore the handler to the capture phase and inspect the event's target there to see if it's disabled or aria-disabled instead?

Other components that exhibit the same regressed behavior: combobox, dropdown, and input-time-zone.

Regression?

2.6.0

Priority impact

p2 - want for current milestone

Impact

This change in behavior is breaking our tests in ways that are not easily solvable and preventing us from upgrading to Calcite 2.7. Going forward, it also prevents us from implementing UI with any sort of click cancelation.

A workaround could be to have our handlers relay a new click event to the window, but that doesn't solve the problem where the cancelation was intended to prevent bubbling up to another handler that is also on the window.

Calcite package

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

Esri team

ArcGIS Field Apps

nwhittaker avatar Mar 28 '24 02:03 nwhittaker