Klaro loses its autofocus when the main page, into which Klaro has been loaded, focuses on one of its own elements. Accepting or rejecting cookie consent should be first thing on focus (if the autofocus is set to true in config). This is an accessibility issue for keyboard navigation.
To test this issue in action:
Set autofocus to true in config.js located in klaro-js/dist/config.js
In the simple.html located in klaro-js/dist/examples/simple.html, add an input element in the body with an id, for example <input id="autofocus-test"></input>, then create a new script tag like so <script>document.getElementById("autofocus-test").focus()</script>
Opening the example page simple.html will result the focus going to the input box instead of klaro's cookie notice.
Klaro loses its autofocus when the main page, into which Klaro has been loaded, focuses on one of its own elements. Accepting or rejecting cookie consent should be first thing on focus (if the
autofocus
is set totrue
in config). This is an accessibility issue for keyboard navigation.To test this issue in action:
autofocus
totrue
in config.js located inklaro-js/dist/config.js
simple.html
located inklaro-js/dist/examples/simple.html
, add an input element in the body with an id, for example<input id="autofocus-test"></input>
, then create a new script tag like so<script>document.getElementById("autofocus-test").focus()</script>
simple.html
will result the focus going to the input box instead of klaro's cookie notice.