Skip to content

Commit

Permalink
Update gatsby-browser.js
Browse files Browse the repository at this point in the history
removing focus on location.hash and moving that work to another ticket for exploration and further problem solving / testing
  • Loading branch information
SalazarJosh committed Jan 14, 2025
1 parent dc22be4 commit 3b81d07
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,9 @@ export const onRouteUpdate = ({ location, prevLocation }) => {
const stickyHeader = document.querySelector('#dateViewerBar');
const headerHeight = stickyHeader ? stickyHeader.offsetHeight : 0;
window.scrollTo({
top: element.offsetTop - headerHeight,
behavior: 'smooth'
behavior: 'smooth',
top: element.offsetTop - headerHeight
});
// Ensure the element is focusable
element.setAttribute('tabindex', '0');
element.style.outline = 'none';

// Focus the element for proper tab order
element.focus({ preventScroll: true });
element.removeAttribute('tabindex');
}
}
};
Expand Down

0 comments on commit 3b81d07

Please sign in to comment.