From b79635c620c4d2ec514747d5d15f87ce8b819124 Mon Sep 17 00:00:00 2001 From: Rebecca Cremona Date: Fri, 2 Feb 2024 10:51:39 -0500 Subject: [PATCH] In fix for navigating to in-page hashes within the ShadowDOM, move focus when scrolling screen. --- src/components/cap-jurisdictions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/cap-jurisdictions.js b/src/components/cap-jurisdictions.js index bf07308..a88533c 100644 --- a/src/components/cap-jurisdictions.js +++ b/src/components/cap-jurisdictions.js @@ -130,7 +130,9 @@ export default class CapJurisdictions extends LitElement { if (hash) { const element = this.shadowRoot.getElementById(hash); if (element) { + element.tabIndex = -1; element.scrollIntoView(); + element.focus(); } } }