Carbon modal loses focus return after programmatic dismissal
0 reputation · 29 Sept 2023, 03:47 UTC
Carbon modal focus return after programmatic dismissal
When a Carbon modal is dismissed programmatically, keyboard focus does not reliably return to the element that triggered the dialog. On older browsers this can leave focus in the document body or trap it inside the closed overlay, blocking further Tab navigation.
The goal is to restore focus to the triggering element after dismissal without introducing custom focus handlers that conflict with Carbon’s built-in modal management. It is unclear whether the behavior differs by Carbon version, dismissal method, or browser support for the inert attribute.
Does Carbon provide a documented focus-return configuration for modals dismissed outside of user interaction? Should focus restoration be handled in the application layer or through Carbon’s modal API? Are there known browser exceptions where focus return fails after programmatic close?