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:
parent
b8d5f951f6
commit
898c75a05c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue