[Bug 39209] New: Cookie consent banner should be 'focused' on load
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Bug ID: 39209 Summary: Cookie consent banner should be 'focused' on load Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org We've had an accessibility audit highlight that the cookie consent banner is 'in a strange order' for keyboard navigation.
Issue • The cookie banner current sits in a slightly odd place in the focus order, coming after the ‘Advanced Search’ link • This might be somewhat disorientating for screen reader users. It may also be frustrating for sighted keyboard users who would like want to dismiss this prior to exploring the page
Solution • Review the order of focus (by tabbing through the page) to ensure the journey users take through the page and within elements is the most logical and efficient, and matches the visible order of content • Move the cookie banner so it can be dismissed as the first action on the page • NB – avoid using positive tabindex values to artificially modify the focus order
I've researched this a little and there's evidence that moving the banner to the top is detrimental to engagement. Other research suggests that as soon as a cookie banner appears, it should take the initial keyboard focus. I propose we take the later approach and if the cookie consent banner is present on the page it should take the first focus point until dismissed at which point the focus should be reset. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 178786 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178786&action=edit Bug 39209: Set cookie consent bar as first focus This patch updates the cookie consent javascript, when the feature is enabled, to ensure that the cookie consent bar gets focused when it displays. Test plan 1) Enable the CookieConsent preference 2) Open any OPAC page 3) Hit 'tab' and note the display of 'Skip to main content' 4) Confirm that the cookie consent bar is displayed and continued 'tabs' eventually navigate to it 5) Apply this patch 6) Navigate to any OPAC page 7) Hit 'tab' and note that the 'Cookie consent' bar is focused, your keyboard navigation starts with the cookie consent buttons 8) Accept the essential cookies 9) Hit tab and note the focus is back to normal and shows the 'Skip to main content' button on first keyboard navigation. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.field@ptfs-europe. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178786|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 178894 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178894&action=edit Bug 39209: Set cookie consent bar as first focus This patch updates the cookie consent javascript, when the feature is enabled, to ensure that the cookie consent bar gets focused when it displays. Test plan 1) Enable the CookieConsent preference 2) Open any OPAC page 3) Hit 'tab' and note the display of 'Skip to main content' 4) Confirm that the cookie consent bar is displayed and continued 'tabs' eventually navigate to it 5) Apply this patch 6) Navigate to any OPAC page 7) Hit 'tab' and note that the 'Cookie consent' bar is focused, your keyboard navigation starts with the cookie consent buttons 8) Accept the essential cookies 9) Hit tab and note the focus is back to normal and shows the 'Skip to main content' button on first keyboard navigation. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Thanks for the quick signoff Owen, very much appreciated :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js` if ( $(window).scrollTop() >= wrapper.offset().top + - wrapper.outerHeight() - - window.innerHeight + wrapper.outerHeight() - + window.innerHeight ) { Now that should be tidy. Dont ask me why :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- - document.querySelector('body').setAttribute('tabindex', '-1'); - document.querySelector('body').focus(); - document.querySelector('body').removeAttribute('tabindex'); + document.querySelector("body").setAttribute("tabindex", "-1"); + document.querySelector("body").focus(); + document.querySelector("body").removeAttribute("tabindex"); Also replacing single quotes here. Do we really want that ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Jonathan Druart: Please see previous two comments. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Marcel de Rooy from comment #5)
- document.querySelector('body').setAttribute('tabindex', '-1'); - document.querySelector('body').focus(); - document.querySelector('body').removeAttribute('tabindex'); + document.querySelector("body").setAttribute("tabindex", "-1"); + document.querySelector("body").focus(); + document.querySelector("body").removeAttribute("tabindex");
Also replacing single quotes here. Do we really want that ?
I believe we had some bits where we replaced with double quotes because of a security risk. And for translatable strings there also used to be a coding guideline, so for example French users don't break JS when using ' in their translations. Do you see an issue with the change? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178894|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 179385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179385&action=edit Bug 39209: Set cookie consent bar as first focus This patch updates the cookie consent javascript, when the feature is enabled, to ensure that the cookie consent bar gets focused when it displays. Test plan 1) Enable the CookieConsent preference 2) Open any OPAC page 3) Hit 'tab' and note the display of 'Skip to main content' 4) Confirm that the cookie consent bar is displayed and continued 'tabs' eventually navigate to it 5) Apply this patch 6) Navigate to any OPAC page 7) Hit 'tab' and note that the 'Cookie consent' bar is focused, your keyboard navigation starts with the cookie consent buttons 8) Accept the essential cookies 9) Hit tab and note the focus is back to normal and shows the 'Skip to main content' button on first keyboard navigation. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Amended-by: Jonathan Druart Run tidy.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Marcel de Rooy from comment #6)
Jonathan Druart: Please see previous two comments.
I don't understand. I have run tidy.pl and amended the patch. Now all looks good to me. Only new lines added and the QA script is happy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|OPAC |Accessibility CC| |martin.renvoize@openfifth.c | |o.uk, | |matt.blenkinsop@openfifth.c | |o.uk, oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Are we happy here at this stage? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |domm@plix.at --- Comment #11 from Thomas Klausner <domm@plix.at> --- Works as advertised (unless you have the "I still don't care about cookies" firedox extension installed, which automatically clicks the least invasive option and thus the consent bar is not shown. So if you have something like that, be sure to disable it before testing...) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Thomas Klausner <domm@plix.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179385|0 |1 is obsolete| | --- Comment #12 from Thomas Klausner <domm@plix.at> --- Created attachment 180385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180385&action=edit Bug 39209: Set cookie consent bar as first focus This patch updates the cookie consent javascript, when the feature is enabled, to ensure that the cookie consent bar gets focused when it displays. Test plan 1) Enable the CookieConsent preference 2) Open any OPAC page 3) Hit 'tab' and note the display of 'Skip to main content' 4) Confirm that the cookie consent bar is displayed and continued 'tabs' eventually navigate to it 5) Apply this patch 6) Navigate to any OPAC page 7) Hit 'tab' and note that the 'Cookie consent' bar is focused, your keyboard navigation starts with the cookie consent buttons 8) Accept the essential cookies 9) Hit tab and note the focus is back to normal and shows the 'Skip to main content' button on first keyboard navigation. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Amended-by: Jonathan Druart Run tidy.pl Signed-off-by: Thomas Klausner <domm@plix.at> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|25.05.00 |25.05.00,24.11.08 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39209 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org