Skip to content

Commit ed211ca

Browse files
committed
fix(Sidebar): select the active link when the current URL starts with href
1 parent 52a235b commit ed211ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/src/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Navigation extends BaseComponent {
111111
})
112112
}
113113

114-
if (!this._config.activeLinksExact && element.href.startsWith(currentUrl)) {
114+
if (!this._config.activeLinksExact && currentUrl.startsWith(element.href)) {
115115
element.classList.add(CLASS_NAME_ACTIVE)
116116
// eslint-disable-next-line unicorn/no-array-for-each
117117
Array.from(this._getParents(element, SELECTOR_NAV_GROUP)).forEach(element => {

0 commit comments

Comments
 (0)