What should happen to focus when a Clarity dropdown closes via Escape?
24.5K reputation · 24 Oct 2020, 13:55 UTC
When a user closes a Clarity <clr-dropdown> panel by pressing the Escape key, the component removes the dropdown from the DOM but does not move focus back to any element.
This leaves keyboard focus on the next focusable item in the page or without a visible focus indicator, which conflicts with WCAG 2.1 Success Criteria 2.1.1 (Keyboard) and 2.4.7 (Focus Visible). The Clarity team has logged an open accessibility discussion about whether focus should return to the dropdown toggle or to the last selected item, and no consensus has been reached in the current stable release.
Given that custom dropdown templates may inadvertently restore focus and that earlier Clarity versions handled focus differently, what is the intended focus‑return behavior for the <clr-dropdown> when closed via Escape, and which element should receive focus to satisfy accessibility guidelines?