Skip to content

Commit

Permalink
fix(h5): 修复在部分浏览器中调用选取媒体的 API 会导致页面滚动的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyucoding committed Apr 20, 2019
1 parent 7b65fa3 commit 5badfe6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/platforms/h5/service/api/media/choose-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const _createInput = function (options) {
'visibility': 'hidden',
'z-index': -999,
'width': 0,
'height': 0
'height': 0,
'top': 0,
'left': 0
})
inputEl.accept = 'image/*'
if (options.count > 1) {
Expand Down
4 changes: 3 additions & 1 deletion src/platforms/h5/service/api/media/choose-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const _createInput = function (options) {
'visibility': 'hidden',
'z-index': -999,
'width': 0,
'height': 0
'height': 0,
'top': 0,
'left': 0
})
inputEl.accept = 'video/*'
// 经过测试,仅能限制只通过相机拍摄,不能限制只允许从相册选择。
Expand Down

0 comments on commit 5badfe6

Please sign in to comment.