diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index 333ddf80f..6a2eae348 100644 --- a/bookwyrm/static/css/bookwyrm.css +++ b/bookwyrm/static/css/bookwyrm.css @@ -30,15 +30,19 @@ body { overflow-x: auto; } +/* stylelint-disable no-descending-specificity */ .modal-card:focus { outline-style: auto; } + .modal-card:focus:not(:focus-visible) { outline-style: initial; } + .modal-card:focus-visible { outline-style: auto; } +/* stylelint-disable no-descending-specificity */ .modal-card.is-fullwidth { min-width: 75% !important; diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 5f062f786..8c2f107bc 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -414,7 +414,17 @@ let BookWyrm = new class { } function handleFocusTrap(event) { - const focusableEls = event.currentTarget.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'); + const focusableEls = event.currentTarget.querySelectorAll( + [ + 'a[href]:not([disabled])', + 'button:not([disabled])', + 'textarea:not([disabled])', + 'input[type="text"]:not([disabled])', + 'input[type="radio"]:not([disabled])', + 'input[type="checkbox"]:not([disabled])', + 'select:not([disabled])' + ].join(',') + ); const firstFocusableEl = focusableEls[0]; const lastFocusableEl = focusableEls[focusableEls.length - 1]; diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 4a7457dca..7296f136c 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -285,7 +285,7 @@ - {% endif %}