From 3f2fbc1225d1eaa15066ef2c9c205274f64b9fe6 Mon Sep 17 00:00:00 2001 From: bailitugeu <2267844855@qq.com> Date: Wed, 3 Jan 2018 15:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E4=B8=80=E6=A0=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=9C=A8SwipeOut=E5=85=83=E7=B4=A0=E4=B8=8A=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E8=A7=A6=E5=8F=91?= =?UTF-8?q?onPanStart,=20onPanMove=EF=BC=8C=E4=BD=86=E5=9C=A8=E4=B8=80?= =?UTF-8?q?=E6=A0=B9=E6=89=8B=E6=8C=87=E6=BB=91=E5=8A=A8=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E5=A6=82=E6=9E=9C=E5=86=8D=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E6=A0=B9=E6=89=8B=E6=8C=87=E8=BF=9B=E6=9D=A5=E4=B8=80=E8=B5=B7?= =?UTF-8?q?=E6=BB=91=E5=8A=A8=E5=B9=B6=E4=B8=80=E8=B5=B7=E7=A6=BB=E5=BC=80?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=EF=BC=8C=E9=82=A3=E4=B9=88=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E7=95=8C=E9=9D=A2=E4=BC=9A=E5=8D=A1=E5=9C=A8=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E6=A0=B9=E6=89=8B=E6=8C=87=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E7=94=BB=E9=9D=A2=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=86=8D=E6=BB=91=E5=8A=A8=EF=BC=88=E6=AD=A4=E6=97=B6left?= =?UTF-8?q?=E6=88=96=E8=80=85right=E5=B1=95=E7=A4=BA=E9=83=A8=E5=88=86?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89open=EF=BC=89=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E4=B8=A5=E9=87=8D=E7=9A=84=E6=98=AF=E5=A6=82=E6=9E=9C=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AEautoClose=EF=BC=8C?= =?UTF-8?q?=E4=BE=BF=E5=86=8D=E4=B9=9F=E6=97=A0=E6=B3=95=E5=A4=8D=E5=8E=9F?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E7=8A=B6=E6=80=81=EF=BC=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=E7=9A=84=E8=AF=9D=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8C=89=E9=92=AE=E5=A4=8D=E5=8E=9F=E3=80=82?= =?UTF-8?q?=E5=85=B6=E4=B8=AD=E5=8E=9F=E5=9B=A0=E5=B0=B1=E6=98=AF=E5=9B=A0?= =?UTF-8?q?=E4=B8=BAgesture=E4=B8=ADcheckIfSingleTouchMove=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=88=B0=E4=B8=A4=E6=A0=B9=E6=89=8B=E6=8C=87=E5=8F=98?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=BC=9A=E6=89=A7=E8=A1=8ConPanEnd=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E4=BC=9A=E6=89=A7=E8=A1=8ConPancancel=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E9=9C=80=E8=A6=81=E6=A0=BC=E5=A4=96=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEonPanCancel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when you touch one finger on the SwipeOut and move your finger , it will trigger onPanStart and onPanMove and works fine, but when you put another finger on and move meanwhile, and suddenly move out your two finger, the SwipeOut will get stucked, and can't be swiped anymore, especilly when you don't set autoClose, it will not go back to the initial state anymore except to reload. The reason is that when gesture's function checkIfSingleTouchMove detectd multifinger and will not trigger onPanEnd anymore , instead it trigger onPanCancel, so we need to set onPanCancel additionally. fix bug when swipeout can't trigger onPanEnd, and swipeout can't work normally anymore. --- src/Swipeout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Swipeout.tsx b/src/Swipeout.tsx index ab8062c..6851c46 100644 --- a/src/Swipeout.tsx +++ b/src/Swipeout.tsx @@ -241,6 +241,7 @@ export default class Swipeout extends React.Component { onPanStart={this.onPanStart} onPanMove={this.onPanMove} onPanEnd={this.onPanEnd} + onPanCancel={this.onPanEnd} onSwipeLeft={this.doOpenRight} onSwipeRight={this.doOpenLeft} direction="horizontal"