-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageUploader 组件在ios上拍照上传图片后会刷新页面 #6026
Comments
这个应该是IOS系统层面的bug。在Safari、钉钉、QQ、微信等浏览器,通过h5 唤起相机后(不论是否拍照)返回,都高概率刷新网页,但从相册里选择照片不会刷新。 推测原因:IOS系统在打开相机时需要较高的运行内存,webview作为高内存占用的后台进程会被优先自动杀掉,来确保 相机 能正常运行。从相机返回时,检测webview已被杀死,所以触发了webview进程重启(刷新)。 这个问题暂无有效解决方案,如果用户遇到了,可以建议他使用相册再试。 |
如果我不想给予选择相机的选项呢,需要怎么配置 |
h5应该没有这个能力,目前我了解到的关于选择图片的方案有以下两种: 1、点击直接唤起拍照: <input type="file" accept="image/*" capture="environment" /> 后置摄像头
<input type="file" accept="image/*" capture="user" /> 前置摄像头 2、点击出现 相册、拍照、文件 选择弹框 <input type="file" accept="image/*" /> 目前这个刷新问题仅存在于IOS部分系统,如IOS16.2,概率较高的偶现。 |
这就close了?是怎么解决的呀? |
小程序webview可以试试这个方案: 微信小程序webview组件拍照页面重载刷新bug解决方案 https://mp.weixin.qq.com/s/1QpyKLLuJMYcRd2t9fOgOA |
Version of antd-mobile
5.24.1
Operating system and its version
No response
Browser and its version
ios 12
Sandbox to reproduce
No response
What happened?
ImageUploader 组件在ios上拍照上传图片后会刷新页面,导致上传的图片数据丢失
Relevant log output
No response
The text was updated successfully, but these errors were encountered: