Skip to main content
Version: v6

A modal or dialog element does not return user focus to the triggering element after close

A modal or dialog element does not return user focus to the triggering element after close — rule summary
FieldValue
Rule codeManual_ModalRefocus_Missing
WCAG conformance levelA
WCAG success criterion1.3.1 Info and Relationships
Must be fixed at sourceNo

Description

We detected a modal or dialog element that did not return focus to the element which triggered its opening after the modal or dialog was closed. This can cause accessibility issues, as users relying on keyboards or assistive technologies may become disoriented, making it difficult for them to understand their point of regard. The element which triggered the opening of the modal should receive focus when the modal is closed or dismissed to ensure it is accessible to all users.

How to fix

Ensure that the element which triggered the opening of the modal receives focus when the modal is closed or dismissed. Examples of common instances include chat widgets; when the "X" button or close symbol inside the chat window is clicked, the users keyboard focus should return to the chat widget activation button which originally opened the chat window. In instances where a modal appears on page load there might not be an activation button, in which case the users focus should be sent to the first interactive element on the page after the modal is dismissed (usually the "Skip to Main" link or an element in the nav region)