SAP / spartacus

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud that communicates exclusively through the Commerce REST API.
Apache License 2.0
726 stars 372 forks source link

Feature: accessibility: close Modals/Popup on ESC key #15024

Open devzom opened 2 years ago

devzom commented 2 years ago

Is your feature request related to a problem? Please describe. It's not really useful and accessible to need to close modals by mouse click.

Describe the solution you'd like Opened modals should allow to close them on ESC key press.

Describe alternatives you've considered none

Additional context none

Xymmer commented 2 years ago

Hi @devzom, is there a specific modal you are referring to? seems like we do this as standard practice but definitely could have missed some

devzom commented 2 years ago

Hey @Xymmer , sorry for limited information about the issue. I'll explain it now. : ]

That's true that the basic 'Close modal on ESC key' works for the first when user trigger modal open and suddenly use the ESC key

The issue happened in specific situation when user click some action trigger -> modal open -> and then focus the visible modal by mouse click, in this moment it's unavailable to close the modal by ESC key press.

I've tested it on:

EDIT: 28.02.2022

Should I add a video?

best regards, Jacob

Xymmer commented 2 years ago

great! thanks, we'll try to repro and fix

echianese commented 2 years ago

@Xymmer I am working on this issue. Note that I am the assignee. Did you know that?

Xymmer commented 2 years ago

assigning to Dalvir