From a0256459725f6a6eec3bcbc57e473fb601580700 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 4 Jan 2025 14:38:48 +0200 Subject: [PATCH] fix(mobile): clicking sidebar backdrop to hide it --- src/public/app/widgets/mobile_widgets/sidebar_container.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/public/app/widgets/mobile_widgets/sidebar_container.ts b/src/public/app/widgets/mobile_widgets/sidebar_container.ts index 048a7f09a..0c89bbd78 100644 --- a/src/public/app/widgets/mobile_widgets/sidebar_container.ts +++ b/src/public/app/widgets/mobile_widgets/sidebar_container.ts @@ -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)); @@ -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.");