carbon-design-system / ibm-products

A Carbon-powered React component library for IBM Products
https://ibm-products.carbondesignsystem.com
Apache License 2.0
97 stars 138 forks source link

[a11y]: Export Modal, unable to close dialog using esc key, after exporting. #6016

Closed devadula-nandan closed 1 month ago

devadula-nandan commented 1 month ago

Package

@carbon/ibm-products

Browser

Firefox

Operating System

Windows

Package version

v2.49.0-rc.0

React version

No response

Automated testing tool and ruleset

manual

Assistive technology

JAWS

Description

Reported by Raghu during the QA Audit

After exporting the file, a success message appears in same dialog. Unable to close dialog using esc. The Modal expected to close with a press of Escape key

WCAG 2.1 Violation

2.1.1. Keyboard access

Reproduction/example

https://ibm-products.carbondesignsystem.com/?path=/story/ibm-products-components-export-exportmodal--standard&globals=viewport:basic

Steps to reproduce

This was reported in all variants of the Export Modal. open export modal, and click on export button, wait for success message. try to close the modal with esc key and notice it doesn't close

Code of Conduct

devadula-nandan commented 1 month ago

it looks like the focus is getting reset to the default body due to a re-render ? 🤔

Screenshot 2024-09-06 at 2 21 51 PM
anamikaanu96 commented 1 month ago

Focus issue is solved via issue, now the Dialog is closing after pressing esc 2 times. This is the expected behaviour since export modal is using composed modal from carbon.

Behaviour of composed modal in carbon.

https://github.com/user-attachments/assets/39f419ff-7c38-46b4-a34b-e5aed2639f17

amal-k-joy commented 1 month ago

Hi @devadula-nandan , As confirmed by the carbon team on this slack discussion, its the expected behaviour to close modal on second escape only

_

After discussing with the team, we clarified the hierarchy of the ESC functionality, which typically ranges from the most specific to broader applications. For instance, a user might prefer to dismiss the tooltip only while still being able to read the modal. In short, this is the expected behaviour.

_