Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue with Klaro autofocus #510

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barunespadhy
Copy link

@barunespadhy barunespadhy commented May 29, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant