Esri / calcite-design-system

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

[Dialog] Close contextual elements with the `Esc` key in visual order #6456

Open geospatialem opened 1 year ago

geospatialem commented 1 year ago

Description

Provide similar behavior to keyboard functionality to mouse users where if multiple modal dialogs are opened, the Esc key provides similar functionality to when selecting the components close button.

cc @Anastasiia-Boleiko

Acceptance Criteria

If multiple modal dialog windows are open and the Esc key is pressed, the most recently opened (highest order, or visually prominent) should be closed first. The order should follow until the last dialog is closed.

Relevant Info

Came up in #6292 as a nice to have, but was out of scope for the bug fix.

Which Component

modal

Example Use Case

https://codepen.io/anastasiia-zrh/pen/MWBvZdB

Esri team

ArcGIS Urban

avkolomeets commented 1 year ago

Another case related to this one is to close an open popover first on the 1st Esc press, then close the modal on the 2nd Esc press. Right now hitting Esc closes both at once.

Example Use Case

https://codepen.io/cont-kolomeets/pen/RwqzgqP?editors=100

image

geospatialem commented 2 months ago

Spike to determine if the new dialog needs to be updated to handle modal with the visual order specified above has the current functionality, or if needed, should be supported with the deprecation of modal in the upcoming 2.11.0 release (7/30).

github-actions[bot] commented 4 days ago

Installed and assigned for verification.

geospatialem commented 4 days ago

Adding some notes @Elijbet compiled for testing out the functionality in the attached PR ✨💪🏻✨