Skip to content

Commit 5b98d74

Browse files
committed
case insensitive links for active navi items
1 parent 5a2b7d1 commit 5b98d74

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/shared/utils/contentful.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ export function target(baseUrl, item) {
5050
* @param {String} item
5151
*/
5252
export function isActive(baseUrl, item, caller) {
53-
const to = removeTrailingSlash(target(baseUrl, item));
53+
let to = removeTrailingSlash(target(baseUrl, item));
54+
to = to ? to.toLowerCase() : to;
5455

5556
let location;
5657
if (isomorphy.isClientSide()) {
5758
location = isAbsolute(to) ? buildUrl(window.location.origin, window.location.pathname)
5859
: window.location.pathname;
60+
location = location.toLowerCase();
5961
} else {
6062
// TODO: should probably get the current URL from the web framework
6163
return false;

0 commit comments

Comments
 (0)