fix blur thing for external link

This commit is contained in:
dora 2021-05-24 20:24:07 -04:00 committed by Amy Wang
parent 6f3b5f2c07
commit be4ff8af56
1 changed files with 10 additions and 1 deletions

View File

@ -75,7 +75,16 @@ function NavItem(props: NavLink) {
return (
<>
{externalLink ? (
<a href={props.route} target="_blank" rel="noopener noreferrer">
<a
href={props.route}
target="_blank"
rel="noopener noreferrer"
onClick={() => {
if (document.activeElement instanceof HTMLElement) {
document.activeElement.blur();
}
}}
>
{props.name}
</a>
) : (