提交 ac23c8d7 编写于 作者: D DCloud_LXH

feat(H5): textarea support inputmode question/161509

上级 0da4fbd7
......@@ -39,6 +39,7 @@
:class="{ 'uni-textarea-textarea-fix-margin': fixMargin }"
:style="{ 'overflow-y': autoHeight ? 'hidden' : 'auto' }"
:enterkeyhint="confirmType"
:inputmode="inputmode"
class="uni-textarea-textarea"
@change.stop
@compositionstart.stop="_onComposition"
......@@ -73,6 +74,7 @@ import {
} from 'uni-mixins'
const DARK_TEST_STRING = '(prefers-color-scheme: dark)'
const ConfirmTypes = ['done', 'go', 'next', 'search', 'send'] // 'return'
const INPUT_MODES = ['none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url']
export default {
name: 'Textarea',
mixins: [field],
......@@ -111,6 +113,13 @@ export default {
validator (val) {
return ConfirmTypes.concat('return').includes(val)
}
},
inputmode: {
type: String,
default: undefined,
validator (value) {
return !!~INPUT_MODES.indexOf(value)
}
}
},
data () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册