Skip to content

A platform for community discussion. Free, open, simple.

FIX: ensures swipe works with scroll (#23508)

Joffrey JAFFEUX898c75a05cee
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs
index 358f1ba1106..0c4b5322781 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs
@@ -166,8 +166,6 @@ export default class ChatChannelRow extends Component {
@bind
onSwipe(event) {
- event.preventDefault();
-
const touchX = event.changedTouches[0].screenX;
const diff = this.initialX - touchX;
@@ -193,8 +191,10 @@ export default class ChatChannelRow extends Component {
this.isCancelling = !this._towardsThreshold;
}
- this.actionButton.style.width = diff + "px";
- this.swipableRow.style.left = -(this.initialX - touchX) + "px";
+ if (diff > 25) {
+ this.actionButton.style.width = diff + "px";
+ this.swipableRow.style.left = -(this.initialX - touchX) + "px";
+ }
}
@bind