Skip to content

Commit

Permalink
fix(mobile): clicking sidebar backdrop to hide it
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jan 4, 2025
1 parent fb5391a commit a025645
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/public/app/widgets/mobile_widgets/sidebar_container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export default class SidebarContainer extends FlexContainer {
doRender() {
super.doRender();

this.$widget.on("click", () => {
this.triggerCommand('setActiveScreen', { screen: "detail" });
});

document.addEventListener("touchstart", (e) => this.#onDragStart(e));
document.addEventListener("touchmove", (e) => this.#onDragMove(e), { passive: false });
document.addEventListener("touchend", (e) => this.#onDragEnd(e));
Expand Down Expand Up @@ -133,6 +129,9 @@ export default class SidebarContainer extends FlexContainer {

const sidebarEl = document.getElementById("mobile-sidebar-wrapper");
const backdropEl = document.getElementById("mobile-sidebar-container");
backdropEl?.addEventListener("click", () => {
this.triggerCommand('setActiveScreen', { screen: "detail" });
});

if (!sidebarEl || !backdropEl) {
throw new Error("Unable to find the sidebar or backdrop.");
Expand Down

0 comments on commit a025645

Please sign in to comment.