From 901d9e4bd0000d571c4051b5f2cda05925776308 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 9 Apr 2020 15:59:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20disableScrollBounce?= =?UTF-8?q?=20=E9=A2=91=E7=B9=81=E8=B0=83=E7=94=A8=E5=AF=BC=E8=87=B4=20iOS?= =?UTF-8?q?13=20=E7=9B=91=E5=90=AC=20click=20=E5=A4=B1=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/scroll.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/shared/scroll.js b/src/shared/scroll.js index 28ffa5a659..93ad9b922a 100644 --- a/src/shared/scroll.js +++ b/src/shared/scroll.js @@ -4,6 +4,7 @@ import { let view let pullToRefreshStyle let disabled +const lastAction = {} export function disableScrollBounce ({ disable @@ -22,7 +23,12 @@ export function disableScrollBounce ({ })) } } - + const time = Date.now() + if (disable === lastAction.disable && time - lastAction.time < 20) { + return + } + lastAction.disable = disable + lastAction.time = time plusReady(() => { if (plus.os.name === 'iOS') { // 延迟执行避免iOS13触摸卡死 @@ -30,5 +36,5 @@ export function disableScrollBounce ({ } else { exec() } - }) -} + }) +} -- GitLab