mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 13:07:19 +08:00
FIX: ensures swipe works with scroll (#23508)
- do not prevent the event (it was a violation anyways as the touchstart is passive) - waits for at least 25px horizontal move before showing the remove action, it avoids showing the remove while scrolling and moving a little bit horizontally
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user