From 29a06511a9af8639da3134c4703a4b993b7534eb Mon Sep 17 00:00:00 2001 From: Tuukka Ojala Date: Sun, 2 Jul 2023 23:28:02 +0300 Subject: [PATCH] Fix accessibility issues in modal component * Fix modal aria role * Trap focusing with tab / shift+tab inside the modal * Restore keyboard focus when closing modal * Automatically move keyboard focus to first focusable element unless specified otherwise * Keyboard shortcut help modal: move keyboard focus to modal title * Keyboard shortcut help modal: change close control from link to button --- template/templates/common/layout.html | 4 +- ui/static/js/app.js | 2 +- ui/static/js/modal_handler.js | 77 +++++++++++++++++++++++++-- 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/template/templates/common/layout.html b/template/templates/common/layout.html index c63577a0..9ad15a6d 100644 --- a/template/templates/common/layout.html +++ b/template/templates/common/layout.html @@ -116,8 +116,8 @@