orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
https://playground.cookieconsent.orestbida.com/
MIT License
3.68k stars 388 forks source link

[Feat]: When force_consent is active force the focus on the consent banner #579

Open nofx77 opened 9 months ago

nofx77 commented 9 months ago

Description

On page load, when force_consent is active and you navigate with a screen reader (e.g., NVDA), you can still navigate through the rest of the page instead of experiencing the same behavior as when the modal parameter is open.

EX : When press H in NVDA we can access all the header of the page.

Proposed solution

Force the focus on the banner on page load until the user accepts or refuses the cookies.

Additional details

Tested on latest version of NVDA.