提交 aa42d7b3 编写于 作者: Q qiang

fix: 优化 keyboard 组件平台条件判断

上级 37e1e130
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
}, },
watch: { watch: {
focus (val) { focus (val) {
if (val) { if (val && __PLATFORM__ === 'app-plus') {
this.showSoftKeybord() this.showSoftKeybord()
} }
} }
...@@ -49,8 +49,10 @@ export default { ...@@ -49,8 +49,10 @@ export default {
} }
UniViewJSBridge.subscribe('hideKeyboard', this.hideKeyboardTemp) UniViewJSBridge.subscribe('hideKeyboard', this.hideKeyboardTemp)
document.addEventListener('click', iosHideKeyboard, false) document.addEventListener('click', iosHideKeyboard, false)
if (__PLATFORM__ === 'app-plus') {
this.setSoftinputNavBar() this.setSoftinputNavBar()
this.setSoftinputTemporary() this.setSoftinputTemporary()
}
}) })
el.addEventListener('blur', this.onKeyboardHide.bind(this)) el.addEventListener('blur', this.onKeyboardHide.bind(this))
}, },
...@@ -106,7 +108,9 @@ export default { ...@@ -106,7 +108,9 @@ export default {
onKeyboardHide () { onKeyboardHide () {
UniViewJSBridge.unsubscribe('hideKeyboard', this.hideKeyboardTemp) UniViewJSBridge.unsubscribe('hideKeyboard', this.hideKeyboardTemp)
document.removeEventListener('click', iosHideKeyboard, false) document.removeEventListener('click', iosHideKeyboard, false)
if (__PLATFORM__ === 'app-plus') {
this.resetSoftinputNavBar() this.resetSoftinputNavBar()
}
// 修复ios端显示与点击位置错位的Bug by:wyq // 修复ios端显示与点击位置错位的Bug by:wyq
if (String(navigator.vendor).indexOf('Apple') === 0) { if (String(navigator.vendor).indexOf('Apple') === 0) {
document.documentElement.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop) document.documentElement.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册