Royal-Navy/design-system

Add focus trap to Modal

jpveooys opened this issue · 0 comments

Description

Currently the Modal doesn't have a focus trap. This means when a Modal is active, you can still press Tab on the keyboard to focus and then interact with things outside the modal.

IIRC this can be resolved by using the <dialog> element in modal mode i.e. using showModal (if support for it is considered good enough now).

Alternatively, focus-trap-react could be used (as it is in DatePicker).