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

[Modal] calciteModalClose should not fire when open prop is toggled to false #7724

Open rpanichakit9541 opened 1 year ago

rpanichakit9541 commented 1 year ago

Check existing issues

Actual Behavior

Currently, calciteModalClose event fires both when "X" is clicked or if the open prop is toggled to false.

Expected Behavior

I asked @driskull and he said it should only fire on "X" click and not when open is toggled to false.

Reproduction Sample

https://codepen.io/rpanichakit/pen/qBLmRRN?editors=1001

Reproduction Steps

  1. Open modal
  2. click "Cancel"
  3. observe "close event" output to the console

Reproduction Version

1.8.0

Relevant Info

No response

Regression?

No response

Priority impact

p4 - not time sensitive

Impact

No response

Calcite package

Esri team

ArcGIS Online

geospatialem commented 1 year ago

Add a doc example where user events can be tracked (via keyboard/click) vs. if toggled via an attribute/prop.

geospatialem commented 11 months ago

Re-assigning the documentation update to the January 2024, in alignment and in consideration with the efforts of #3818, where we can explore a new documentation page that contains information on open and additional patterns such as validation, animation, and references mentioned in https://github.com/Esri/calcite-design-system/issues/3818#issuecomment-1015996968.

In the meantime, this is the expected pattern with regards to the open and close events, which are asynchronous as a result of animations. Calcite emits both when setting the property, or when the user closes/opens the component.

The pattern will also be addressed via PR https://github.com/Esri/calcite-design-system/pull/7613 and issue https://github.com/Esri/calcite-design-system/issues/4398.