Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Oct 19, 2022
1 parent 95abdbe commit 4c51eba
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/docusaurus-theme-common/src/utils/skipToContentUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,13 @@ function useSkipToContent(): {
const containerRef = useRef<HTMLDivElement>(null);
const {action} = useHistory();

const onSkipToContentClick = useCallback(
(e: React.MouseEvent<HTMLAnchorElement>) => {
e.preventDefault();
const targetElement = getSkipToContentTarget();
if (targetElement) {
programmaticFocus(targetElement);
}
},
[],
);
const onClick = useCallback((e: React.MouseEvent<HTMLAnchorElement>) => {
e.preventDefault();
const targetElement = getSkipToContentTarget();
if (targetElement) {
programmaticFocus(targetElement);
}
}, []);

// "Reset" focus when navigating.
// See https://github.com/facebook/docusaurus/pull/8204#issuecomment-1276547558
Expand All @@ -73,7 +70,7 @@ function useSkipToContent(): {
}
});

return {containerRef, onClick: onSkipToContentClick};
return {containerRef, onClick};
}

const DefaultSkipToContentLabel = translate({
Expand Down

0 comments on commit 4c51eba

Please sign in to comment.