fix: close root library menu when nav link is clicked

This commit is contained in:
catarrh committed 2026-08-01 22:53:45 +03:00
1 parent 326015af94
commit 88340ecc25
1 file changed
+3 -4
+3 -4
View File
@@ -50,10 +50,9 @@ export class App {
const target = e.target as HTMLElement; const target = e.target as HTMLElement;
const link = target.closest('.nav-link'); const link = target.closest('.nav-link');
if (link) { if (link) {
const details = link.closest('details.nav-group'); document.querySelectorAll('details.nav-group[open]').forEach(d => {
if (details) { d.removeAttribute('open');
details.removeAttribute('open'); });
}
} }
}); });