From 29018029f274a6b9e432e312702c4deb32eede65 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 12 Feb 2021 15:28:20 +0000 Subject: [PATCH 1/2] Fix toggle click tracking on step-by-steps In #1893 we added an SVG to the step by step navigation continuing to rely on the same logic for tracking, but the way the toggle click tracking script is designed expects the element triggering the click event to be an HTMLElement, not a path element, which causes a hard error and fails to send data to GA. With this change, we avoid capturing events at the SVG level, which means they will bubble and be captured by the parent HTMLElement. --- .../components/_step-by-step-nav.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss b/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss index d07e85afa2..936173e566 100644 --- a/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +++ b/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss @@ -141,6 +141,10 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3"); .gem-c-step-nav--large & { margin-left: em(5, 16); } + + svg { + pointer-events: none; + } } .gem-c-step-nav__button-text { From ec05845e60e28b68b8cbfbe9e0bc3fb84e9b1090 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 12 Feb 2021 15:41:34 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c669dff45..666f906914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Update `govuk-frontend` base SCSS imports ([PR #1922](https://github.com/alphagov/govuk_publishing_components/pull/1922)) * Remove redundant import in accordion component ([PR #1923](https://github.com/alphagov/govuk_publishing_components/pull/1923)) +* Fix toggle click tracking on step-by-steps ([PR #1925](https://github.com/alphagov/govuk_publishing_components/pull/1925)) ## 24.1.0