提交 6b3b07b5 编写于 作者: Q qiang

fix(App): 修复安卓 input 组件设置 focus 属性为 true 时键盘收回的问题

上级 22aeb244
...@@ -4,6 +4,7 @@ import { ...@@ -4,6 +4,7 @@ import {
} from 'uni-shared' } from 'uni-shared'
import emitter from './emitter' import emitter from './emitter'
import keyboard from './keyboard' import keyboard from './keyboard'
import interact from './interact'
UniViewJSBridge.subscribe('getSelectedTextRange', function ({ pageId, callbackId }) { UniViewJSBridge.subscribe('getSelectedTextRange', function ({ pageId, callbackId }) {
const activeElement = document.activeElement const activeElement = document.activeElement
...@@ -29,7 +30,7 @@ let startTime ...@@ -29,7 +30,7 @@ let startTime
export default { export default {
name: 'Field', name: 'Field',
mixins: [emitter, keyboard], mixins: [emitter, keyboard, interact],
model: { model: {
prop: 'value', prop: 'value',
event: 'update:value' event: 'update:value'
...@@ -167,7 +168,10 @@ export default { ...@@ -167,7 +168,10 @@ export default {
return return
} }
field.focus() field.focus()
plus.key.showSoftKeybord() // 无用户交互的 webview 需主动显示键盘(安卓)
if (!this.userInteract) {
plus.key.showSoftKeybord()
}
} }
}, },
_blur () { _blur () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册