- Issue created by @manandearth
- last update
about 1 year ago 7 pass - last update
about 1 year ago 7 pass - last update
about 1 year ago 7 pass - Status changed to Needs review
about 1 year ago 12:39pm 4 July 2024 - Issue was unassigned.
- Status changed to Needs work
6 months ago 9:38am 12 February 2025 - leymannx Berlin
This is working really well so far. 👏🏻
The only thing we would like to change is that we would like to prevent that there's a default focus upon opening the page.
Only after the first time pressing tab we would like the first element to be focused.
Hi Norman and manandearth,
Can I ask if this is still on the timeline for the next couple of weeks?
We are using this cookie consent banner on our websites and would also be interested in this update because of the European accessibility act kicking in soon.- leymannx Berlin
@tim - Please help us, checking out the current MR, reviewing if it is working for you, reviewing if it fixes any accessbility issues for you.
Maybe you can even help us solving the problem of the initial focus.
- 🇪🇸Spain aortega1441 Jerez de la Frontera
aortega1441 → changed the visibility of the branch 3452243-accessible-klaro to hidden.
- 🇪🇸Spain aortega1441 Jerez de la Frontera
aortega1441 → changed the visibility of the branch 3452243-accessible-klaro to active.
- Merge request !24Issue #3452243: Accessible klaro patch 52096, default focus → (Open) created by Unnamed author
- 🇪🇸Spain aortega1441 Jerez de la Frontera
Patch to remove default focus from 'privacy policy'.
- leymannx Berlin
Thank you @aortega1441 this looks very promising 🤩
We just should check again on the coding standards in that JS file, the comments in particular, please see https://www.drupal.org/docs/develop/standards/javascript-coding-standard... → .
Non-JSDoc comments SHOULD use capitalized sentences with punctuation. Comments SHOULD be on a separate line, immediately before the code line or block they reference.
- leymannx Berlin
norman.lol → changed the visibility of the branch 3452243-accessible-klaro to hidden.
- leymannx Berlin
norman.lol → changed the visibility of the branch 1.x to hidden.
- leymannx Berlin
Turned out that the only thing that was needed for the initial focus to be removed was to remove the
tabindex="0"
from<div id="klaro-cookie-notice" tabindex="0">
added by the klaro lib. Now I could removefirstFormFocusableElement.focus();
, and even without it the first tab press immediately focused on the first focusable element and stayed fully loop-able after that.But still took me almost a day to get there. 😅
On the way I refactored the code quite a bit:
- added
once
- replaced
document
withcontext
where possible - refactored the actual trap functionality into a separate function
trapFocus
with an option to pass different key press logic to it (depending if used on the main modal or the preference form)
- added
-
norman.lol →
committed 67f2701e on 1.x
Issue #3452243 by manandearth, aortega1441, norman.lol: Improve modal...
-
norman.lol →
committed 67f2701e on 1.x
- leymannx Berlin
norman.lol → changed the visibility of the branch 3452243-a11y to hidden.
- leymannx Berlin
norman.lol → changed the visibility of the branch aortega1441-3452243-accessible-klaro-patch-52096 to hidden.
- Status changed to Fixed
6 days ago 10:37pm 30 July 2025 -
norman.lol →
committed e2d5772e on 1.x
Issue #3452243 by manandearth, aortega1441, norman.lol: Refactor modal...
-
norman.lol →
committed e2d5772e on 1.x
-
norman.lol →
committed 5bf3215d on 1.x
Issue #3452243 by manandearth, aortega1441, norman.lol: Fix hidden...
-
norman.lol →
committed 5bf3215d on 1.x