Skip to content

Commit f70137c

Browse files
committed
fix: simplify sidebar navigation link selection for active route
1 parent b15e46b commit f70137c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/core/render/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,11 @@ export function Render(Base) {
314314

315315
sidebarToggleEl.setAttribute('aria-expanded', String(!isMobile()));
316316

317-
const activeElmHref = this.router.toURL(this.route.path);
318-
const decodedHref = decodeURIComponent(activeElmHref);
317+
const activeElmHref = decodeURIComponent(
318+
this.router.toURL(this.route.path),
319+
);
319320
const activeEl = /** @type {HTMLElement | null} */ (
320-
dom.find(
321-
`.sidebar-nav a[href="${activeElmHref}"]${activeElmHref !== decodedHref ? `, .sidebar-nav a[href="${decodedHref}"]` : ''}`,
322-
)
321+
dom.find(`.sidebar-nav a[href="${activeElmHref}"]`)
323322
);
324323

325324
this.#addTextAsTitleAttribute('.sidebar-nav a');

0 commit comments

Comments
 (0)