From c924f578e5b1555d32ceebfa7aff3fc615578d4d Mon Sep 17 00:00:00 2001 From: Joachim Date: Sun, 28 Nov 2021 18:26:01 +0100 Subject: [PATCH] Fix linting errors --- bookwyrm/static/css/bookwyrm.css | 4 ++++ bookwyrm/static/js/bookwyrm.js | 12 +++++++++++- bookwyrm/templates/layout.html | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index 333ddf80..6a2eae34 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 5f062f78..8c2f107b 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 4a7457dc..7296f136 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -285,7 +285,7 @@ - {% endif %}