Merge pull request #29790 from logonoff/docs

fix(techdocs): Update keyboard focus when clicking hash links
This commit is contained in:
John Philip
2025-05-06 09:29:26 -04:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
@@ -229,6 +229,13 @@ export const useTechDocsReaderDom = (
transformedElement
?.querySelector(`[id="${parsedUrl.hash.slice(1)}"]`)
?.scrollIntoView();
// Focus first focusable element in the target section
(
transformedElement
?.querySelector(`[id="${parsedUrl.hash.slice(1)}"]`)
?.querySelector('a, button, [tabindex]') as HTMLElement
)?.focus();
}
} else {
if (modifierActive) {