From 3b1353b00dbf22f8cdd608f04e40374c2cf11e98 Mon Sep 17 00:00:00 2001 From: ParzivalPavlis Date: Mon, 11 Aug 2025 15:31:43 +0200 Subject: [PATCH 1/7] fix: fixed header mobile menu accessibility risk: low JIRA: DP-3218 --- assets/scss/header.scss | 4 ++++ static/js/menu.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/assets/scss/header.scss b/assets/scss/header.scss index 0bd9eb9..26e71d2 100644 --- a/assets/scss/header.scss +++ b/assets/scss/header.scss @@ -39,6 +39,10 @@ align-items: center; padding: 0 20px; + &__menu { + overflow-y: auto; + } + &__first { top: 0; min-height: $header-first-nav-height; diff --git a/static/js/menu.js b/static/js/menu.js index 33417b6..adc0763 100644 --- a/static/js/menu.js +++ b/static/js/menu.js @@ -1,6 +1,7 @@ // (C) 2023 GoodData Corporation $(document).ready(function () { + // Side menu var menu = $(".gd-docs-menu"), menuActive = $(".gd-docs-menu-page.active"); @@ -36,4 +37,40 @@ $(document).ready(function () { $button.attr("aria-expanded", !isExpanded); }); + // Mobile header menu + var $mobileMenuTrigger = $("#gd-header-mobile-menu-trigger-input"); + var scrollPosition = 0; // Store scroll position + + $mobileMenuTrigger.on("change", function() { + var isChecked = $(this).is(":checked"); + + // Update aria-expanded for accessibility + $(this).attr("aria-expanded", isChecked); + + // Prevent body scrolling when menu is open + if (isChecked) { + // Save current scroll position + scrollPosition = window.pageYOffset || document.documentElement.scrollTop; + + // Menu is open - disable body scroll and maintain position + $("body").css({ + "overflow": "hidden", + "position": "fixed", + "top": -scrollPosition + "px", + "width": "100%" + }); + } else { + // Menu is closed - enable body scroll and restore position + $("body").css({ + "overflow": "", + "position": "", + "top": "", + "width": "" + }); + + // Restore scroll position + window.scrollTo(0, scrollPosition); + } + }); + }); \ No newline at end of file From 0d010ad4bda28a7fb91d0bf2a6baa7f6b6dedd1b Mon Sep 17 00:00:00 2001 From: ParzivalPavlis Date: Tue, 12 Aug 2025 10:57:57 +0200 Subject: [PATCH 2/7] feat: added tab navigation and more accessibility options risk: low JIRA: DP-3219 --- assets/scss/header.scss | 1 + layouts/partials/header-menu.html | 12 ++++++------ static/js/menu.js | 20 ++++++++++++++++---- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/assets/scss/header.scss b/assets/scss/header.scss index 26e71d2..6f6b383 100644 --- a/assets/scss/header.scss +++ b/assets/scss/header.scss @@ -216,6 +216,7 @@ .gd-header-mobile-menu-trigger { margin-bottom: 0; + border: none; } .search-result-close-button { diff --git a/layouts/partials/header-menu.html b/layouts/partials/header-menu.html index 6988874..6b92fad 100644 --- a/layouts/partials/header-menu.html +++ b/layouts/partials/header-menu.html @@ -9,14 +9,14 @@
{{ if $mainMenu }} - - - {{ end }} -
\ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/navbar-breadcrumb.html b/layouts/partials/navbar-breadcrumb.html index 7fff612..4462b25 100644 --- a/layouts/partials/navbar-breadcrumb.html +++ b/layouts/partials/navbar-breadcrumb.html @@ -1,8 +1,10 @@ {{/* (C) 2023 GoodData Corporation */}} {{/* This is overriden in docs (tiger/bear) */}} - + \ No newline at end of file diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 6698ac3..53d0691 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -5,20 +5,18 @@ {{ $cover := .HasShortcode "blocks/cover" }} {{ if not $whitelabeled }} - {{ partial "header-menu.html" . }} {{ partial "header-right.html" . }} - - + {{ else }} - - + {{ end }} \ No newline at end of file From 03372aeaa8306090f73302dfcfa6c91fd6966d6e Mon Sep 17 00:00:00 2001 From: ParzivalPavlis Date: Wed, 13 Aug 2025 10:34:06 +0200 Subject: [PATCH 6/7] fix: added aria label to aritcles navigation risk: low JIRA: DP-3086 --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 0d5204a..45b92fa 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -3,7 +3,7 @@
-