chichiwang / tamsui

An Express/React universal application boilerplate
https://tamsui.dev/
MIT License
0 stars 1 forks source link

useResetScroll: Drive focus on hash-link navigation #139

Closed chichiwang closed 4 months ago

chichiwang commented 4 months ago

Description

Linked to Issue: #129 When using keyboard navigation, following a link with a hash does not drive focus to that section of the page. This PR fixes this by driving focus to the element with the id attribute that matches the link hash.

Since heading tags are not normally tab-focusable, the Heading component has been updated to place the id attribute on the anchor tag instead.

Changes

Steps to QA