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 link = target.closest('.nav-link');
|
||||
if (link) {
|
||||
const details = link.closest('details.nav-group');
|
||||
if (details) {
|
||||
details.removeAttribute('open');
|
||||
}
|
||||
document.querySelectorAll('details.nav-group[open]').forEach(d => {
|
||||
d.removeAttribute('open');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user