Skip to content

Commit

Permalink
fix(sidebar-filter): hide parent container, not parent
Browse files Browse the repository at this point in the history
Avoids unexpected space caused by parent containers
whose containing parent is actually hidden.
  • Loading branch information
caugner committed Jun 6, 2023
1 parent 06467cc commit 4545c46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/document/organisms/sidebar/SidebarFilterer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export class SidebarFilterer {
}

private collapseParent(el: HTMLDetailsElement) {
this.toggleElement(el, false);
const container = this.getContainer(el);
this.toggleElement(container, false);
el.dataset.wasOpen = el.dataset.wasOpen ?? String(el.open);
el.open = false;
}
Expand Down Expand Up @@ -237,7 +238,8 @@ export class SidebarFilterer {
}

private expandParent(parent: HTMLDetailsElement) {
this.toggleElement(parent, true);
const container = this.getContainer(parent);
this.toggleElement(container, true);
parent.open = true;
}

Expand Down

0 comments on commit 4545c46

Please sign in to comment.