fix: close root library menu when nav link is clicked
This commit is contained in:
1 parent
326015af94
commit
88340ecc25
1 file changed
+3
-4
+3
-4
@@ -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');
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user