From 9e696a0305663738d0cc38633f52f4f98a0e6d19 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 9 May 2024 21:16:27 +0200 Subject: [PATCH] FIX: allows to disable body scroll lock on swipe modifier (#26957) Cases like the glimmer-site-header are complex because the swiped area is not the moved target, for now it's simpler to not apply the body scroll lock automatically. A new property is now available on the swipe modifier: `{{swipe @lockBody=false}}` Note I tried to have tests for this modifier in the past, but it was very inconsistent on CI causing lots of flakeys, this is why there are no tests for now. I might try to write them again using system specs. --- .../app/components/glimmer-site-header.gjs | 1 + .../discourse/app/modifiers/swipe.js | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs b/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs index 448e0d540d9..5b16ccb2696 100644 --- a/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs +++ b/app/assets/javascripts/discourse/app/components/glimmer-site-header.gjs @@ -425,6 +425,7 @@ export default class GlimmerSiteHeader extends Component { onDidEndSwipe=this.onSwipeEnd onDidCancelSwipe=this.onSwipeCancel onDidSwipe=this.onSwipe + lockBody=false }} >