diff --git a/src/core/view/mixins/keyboard.js b/src/core/view/mixins/keyboard.js index 8aa7f6956af7cad659b53e60f4898acd9b486880..da9405907bc714f45ea561363a36f4570204ef9e 100644 --- a/src/core/view/mixins/keyboard.js +++ b/src/core/view/mixins/keyboard.js @@ -28,7 +28,7 @@ export default { }, watch: { focus (val) { - if (val) { + if (val && __PLATFORM__ === 'app-plus') { this.showSoftKeybord() } } @@ -49,8 +49,10 @@ export default { } UniViewJSBridge.subscribe('hideKeyboard', this.hideKeyboardTemp) document.addEventListener('click', iosHideKeyboard, false) - this.setSoftinputNavBar() - this.setSoftinputTemporary() + if (__PLATFORM__ === 'app-plus') { + this.setSoftinputNavBar() + this.setSoftinputTemporary() + } }) el.addEventListener('blur', this.onKeyboardHide.bind(this)) }, @@ -106,7 +108,9 @@ export default { onKeyboardHide () { UniViewJSBridge.unsubscribe('hideKeyboard', this.hideKeyboardTemp) document.removeEventListener('click', iosHideKeyboard, false) - this.resetSoftinputNavBar() + if (__PLATFORM__ === 'app-plus') { + this.resetSoftinputNavBar() + } // 修复ios端显示与点击位置错位的Bug by:wyq if (String(navigator.vendor).indexOf('Apple') === 0) { document.documentElement.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop)