From c15c4de7e46e124d9e0840c2b02dcb52b826df01 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 31 Mar 2020 19:47:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ios=20=E7=AB=AF=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E8=BE=93=E5=85=A5=E6=B3=95=E6=94=B6=E8=B5=B7=E5=90=8E?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B1=8F=E5=B9=95=E4=BC=9A=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/mixins/keyboard.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/view/mixins/keyboard.js b/src/core/view/mixins/keyboard.js index 2d706bdfa..7f9b42e7b 100644 --- a/src/core/view/mixins/keyboard.js +++ b/src/core/view/mixins/keyboard.js @@ -44,7 +44,10 @@ export default { methods: { initKeyboard (el) { el.addEventListener('focus', () => { - UniViewJSBridge.subscribe('hideKeyboard', hideKeyboard) + this.hideKeyboardTemp = function () { + hideKeyboard() + } + UniViewJSBridge.subscribe('hideKeyboard', this.hideKeyboardTemp) document.addEventListener('click', iosHideKeyboard, false) this.setSoftinputNavBar() this.setSoftinputTemporary() @@ -101,7 +104,7 @@ export default { } }, onKeyboardHide () { - UniViewJSBridge.unsubscribe('hideKeyboard', hideKeyboard) + UniViewJSBridge.unsubscribe('hideKeyboard', this.hideKeyboardTemp) document.removeEventListener('click', iosHideKeyboard, false) this.resetSoftinputNavBar() } -- GitLab