diff --git a/packages/docusaurus-theme-classic/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx b/packages/docusaurus-theme-classic/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx index d742da2e83fc8..e3c98e4d1d281 100644 --- a/packages/docusaurus-theme-classic/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx @@ -37,7 +37,16 @@ export default function LocaleDropdownNavbarItem({ to, target: '_self', autoAddBaseUrl: false, - isActive: () => locale === currentLocale, + className: + // eslint-disable-next-line no-nested-ternary + locale === currentLocale + ? // Duplicated from DefaultNavbarItem: select the right Infima active + // class name. This cannot be substituted with isActive, because the + // target URLs contain `pathname://` and therefore are not NavLinks! + mobile + ? 'menu__link--active' + : 'navbar__link--active' + : '', }; });