提交 3473df30 编写于 作者: X xiaoyucoding

fix: 修复选择文件后导致页面滚动的问题

上级 9fee8265
......@@ -9,7 +9,7 @@ let imageInput = null
const _createInput = function (options) {
let inputEl = document.createElement('input')
inputEl.type = 'file'
inputEl.style = 'visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.style = 'position: absolute;visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.accept = 'image/*'
if (options.count > 1) {
inputEl.multiple = 'multiple'
......
......@@ -9,7 +9,7 @@ let videoInput = null
const _createInput = function (options) {
let inputEl = document.createElement('input')
inputEl.type = 'file'
inputEl.style = 'visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.style = 'position: absolute;visibility: hidden;z-index: -999;width: 0;height: 0;'
inputEl.accept = 'video/*'
// 经过测试,仅能限制只通过相机拍摄,不能限制只允许从相册选择。
if (options.sourceType.length === 1 && options.sourceType[0] === 'camera') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册