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

Command icon 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

demilua created an issue. See original summary.

jan kellermann made their first commit to this issue’s fork.

jan kellermann’s picture

Status: Active » Needs review

Thank 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!

demilua’s picture

Status: Needs review » Reviewed & tested by the community

Also 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.

jan kellermann’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for your work! I merged the MR.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.