DEV Community

Discussion on: Build a Modal (Pop up) With HTML, CSS and JavaScript

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

This has a few accessibility concerns:

  • Keyboard navigation, can't be dismissed by hitting the escape key
  • Focus isn't moved to the modal when it's opened
  • Focus isn't trapped in the modal, so anyone can tab out to the content beneath
  • Focus isn't returned to the button that triggered it, so keyboard users would be left lost once the modal is dismissed
  • Could benefit from some focus styles on the form elements to give feedback to the user where they're at