Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
285 stars 76 forks source link

Panel `calcitePanelClose` event emitted despite `beforeClose` failing #10220

Open nwhittaker opened 3 weeks ago

nwhittaker commented 3 weeks ago

Check existing issues

Actual Behavior

Given a closable <calcite-panel> with a beforeClose callback that rejects, clicking the panel's close button does not close it. However, the panel still emits a calcitePanelClose event.

Expected Behavior

The panel does not emit a calcitePanelClose event if it does not successfully close.

Reproduction Sample

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

Reproduction Steps

  1. Visit the repro and open the console.
  2. Click the panel's close button and see "calcitePanelClose" is logged.

Reproduction Version

2.12.0

Relevant Info

No response

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

No response

Calcite package

Esri team

ArcGIS Field Apps

geospatialem commented 2 weeks ago

Blocked by https://github.com/Esri/calcite-design-system/issues/10310

jcfranco commented 2 weeks ago

Other components with beforeClose prop to consider: