-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chooseImage 未选择图片取消后,没有触发 fail #862
Comments
H5端不支持,无法实现 |
为何不通过 files.length == 0 来判断 |
Talk is cheap. Show me the code. |
https://github.com/dcloudio/uni-app/tree/dev/src/platforms/h5/service/api/media 你可以fork一份uniapp,改一个适合你自己的出来,如果你觉得也适合给别人用可以向我们提pr |
chrome 里如果弹出选择框前 input 为 focus,则弹出框后会触发 blur,点击取消后会重新触发focus(即框关闭后总会触发 focus)。 |
感谢支持,不过由于 touch 事件时机不准确,所以之前这个方案被放弃了 |
事件时机虽然不准确,但是此实现可以保证程序完整的业务逻辑,在 api 调用上也可以保持一致性。 如果以后标准添加对该功能的支持的话,依然可以换用更好的方案。 不过就目前图片选择在手机 webview 的开发规范而言,在很长一段时间内应该都不会统一到可用的标准方案。所以此实现应该是当前情况下较适合的方案。 一个依赖于取消事件的案例: 希望能在主版本中提供此支持,虽然有点延迟的小问题(实际上对用户而言无感知),但总好过无法实现的业务逻辑吧。 |
这不是优雅和延迟的问题,而是稳定性与可用性的问题,此方式依赖用户的行为,而用户的行为不可控。 |
问题描述
h5 端使用 uni.chooseImage 未选择图片取消后,没有触发 fail,导致无法侦听取消事件。
The text was updated successfully, but these errors were encountered: