Skip to content
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

上传文件选择文件后会第二次弹出选择文件框 #75

Open
GodLyons opened this issue Jul 9, 2020 · 5 comments
Open

上传文件选择文件后会第二次弹出选择文件框 #75

GodLyons opened this issue Jul 9, 2020 · 5 comments

Comments

@GodLyons
Copy link

GodLyons commented Jul 9, 2020

我在issues中找到相似的问题,但是该问题并未解决,复现几率特别小(特别特别小),目前所有的用户加在一起总共复现三次,代表该问题仍然存在,第一次选择后并未上传,第二次才会上传。我是在vue项目中使用的,但是并未使用vue-uploader,而是基于simple-uploader自己封装的上传组件。

@dolymood
Copy link
Member

不确定是什么原因引起的 没法调 可以先自己尝试修复下

@15773200610
Copy link

请教一下,这个问题找到修复方法了吗、??

@GodLyons
Copy link
Author

GodLyons commented Sep 7, 2020

请教一下,这个问题找到修复方法了吗,???

首先确认一下是否创建了多个实例,我之前创建了两个实例,导致了该问题,如果还出现问题的话,我觉得就需要从源码入手了[https://github.com/simple-uploader/Uploader/blob/develop/src/uploader.js#L342] 如果出现触发两次的话大概就是这部分代码,而且我查看之前的issues,这个地方确实有针对这个问题的改动。希望回答对你有帮助

@15773200610
Copy link

谢谢。找到地方了

@15773200610
Copy link

domNode.addEventListener('click', function (e) {
if (domNode.tagName.toLowerCase() === 'label') {
return
}
input.click()
}, false)

注释了一下这里就解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants