DEV Community

Discussion on: Creating a Simple Confirm Modal in Vanilla JS

boyum profile image
Sindre Bøyum Author

For better accessibility it's suggested by the WAI-ARIA doc to set focus on the button that triggered the opening of the modal, however this is not the modal's concern.

Another thing that might be good is to lock focus within the dialog. We could do that with something like the inert attribute.