From bb743ace9f22afd0b96f6e93eb647cd8b03b7e5b Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Fri, 18 Jun 2021 16:37:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20=20=E5=9C=A8iOS?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=B8=8A=EF=BC=8C=E6=89=8B=E5=8A=A8=E8=B0=83?= =?UTF-8?q?=E7=94=A8uni.hideKeyboard()=E5=90=8E=E5=A6=82=E6=9E=9C=E5=86=8D?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=A1=B5=E9=9D=A2=E5=85=B6=E4=BB=96=E5=9C=B0?= =?UTF-8?q?=E6=96=B9=E4=BC=9A=E9=87=8D=E6=96=B0=E8=81=9A=E7=84=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-components/src/helpers/useKeyboard.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/uni-components/src/helpers/useKeyboard.ts b/packages/uni-components/src/helpers/useKeyboard.ts index 05bb3b879..a56db1346 100644 --- a/packages/uni-components/src/helpers/useKeyboard.ts +++ b/packages/uni-components/src/helpers/useKeyboard.ts @@ -226,6 +226,9 @@ export function useKeyboard( } el.addEventListener('blur', () => { + // 在iOS设备上,手动调用uni.hideKeyboard(),键盘收起并且触发blur,但实际并没有blur。 + // 此时如果再点击页面其他地方会重新聚焦,此处做处理 + el.blur() focus = false onKeyboardHide() }) -- GitLab