From 3e54e0fc422b9808d6040a03dcff4503f981b1e6 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 8 Oct 2025 21:46:26 +0300 Subject: [PATCH] fix(client/rtl): sidebar not draggable --- .../src/widgets/mobile_widgets/sidebar_container.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/mobile_widgets/sidebar_container.ts b/apps/client/src/widgets/mobile_widgets/sidebar_container.ts index 5a8510c08..1219ee799 100644 --- a/apps/client/src/widgets/mobile_widgets/sidebar_container.ts +++ b/apps/client/src/widgets/mobile_widgets/sidebar_container.ts @@ -66,7 +66,7 @@ export default class SidebarContainer extends FlexContainer { } const x = "touches" in e ? e.touches[0].clientX : e.clientX; - const deltaX = x - this.startX; + const deltaX = glob.isRtl ? this.startX - x : x - this.startX; if (this.dragState === DRAG_STATE_INITIAL_DRAG) { if (this.currentTranslate === -100 ? deltaX > DRAG_CLOSED_START_THRESHOLD : deltaX < -DRAG_OPENED_START_THRESHOLD) { /* Disable the transitions since they affect performance, they are going to reenabled once drag ends. */ @@ -87,7 +87,11 @@ export default class SidebarContainer extends FlexContainer { const width = this.sidebarEl.offsetWidth; const translatePercentage = Math.min(0, Math.max(this.currentTranslate + (deltaX / width) * 100, -100)); this.translatePercentage = translatePercentage; - this.sidebarEl.style.transform = `translateX(${translatePercentage}%)`; + if (glob.isRtl) { + this.sidebarEl.style.transform = `translateX(${-translatePercentage}%)`; + } else { + this.sidebarEl.style.transform = `translateX(${translatePercentage}%)`; + } this.backdropEl.style.opacity = String(Math.max(0, 1 + translatePercentage / 100)); }