Problem/Motivation
When using the setting "Autofocus Klaro! Dialog" and all services in the first purpose are set to require, the label that would be focused is not focusable and with that, the Klaro! Dialog window looses focus again.
Steps to reproduce
- Set "Klaro! Dialog Mode" to "Consent dialog modal"
- Set "Autofocus Klaro! Dialog" to true.
- Set all the services in the first purposes to be required.
- Trigger the Klaro! Dialog window.
- Press the tabulator key.
Proposed resolution
Set the initial focus not on the first label but the
with the class="cm-modal cm-klaro". That way, the first tab will always go to the first focusable element of the Klaro! Dialog window.
Issue fork klaro-3532563
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
jan kellermann commentedThank you for reporting.
The “Autofocus Klaro! Dialog” option refers to the focus when loading the page. However, you are right that when opening the consent dialog modal, the focus is not set correctly.
I have fixed this with the MR.
Please test it and give us your feedback. Thank you!
Comment #5
demilua commentedAlso here, thank you for your fast work, and I'm really sorry for my slow response.
I tested Klaro! with your patch applied, the autofocus is now inside the Klaro! Dialog window even with all the services in the first purpose set to required.
Comment #7
jan kellermann commentedThank you for your work! I merged the MR.