Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

选择文件,然后removeFile,之后再选这个文件,就选择不了了。 #211

Closed
mrzzcn opened this issue Jun 3, 2014 · 4 comments

Comments

@mrzzcn
Copy link

mrzzcn commented Jun 3, 2014

选择文件,然后removeFile,之后再选这个文件,就选择不了了。

@2betop
Copy link
Contributor

2betop commented Jun 3, 2014

input 的 change 事件没有触发,已经 clone 一份新的 input[type=file] 都这样。且发现,线上的有此 bug 而本地的 examples 下的示例无此 bug。原因待查

@mrzzcn
Copy link
Author

mrzzcn commented Jun 3, 2014

input.on('change', function (e) {
var fn = arguments.callee,clone;
me.files = e.target.files;
// reset input
clone = this.cloneNode(true);
clone.value = null;
this.parentNode.replaceChild(clone, this);
input.off();
input = $(clone).on('change', fn).on('mouseenter mouseleave', mouseHandler);
owner.trigger('change');
});

// clone.value=null;
// clone 之后需要清空选中状态

@mrzzcn
Copy link
Author

mrzzcn commented Jun 3, 2014

自己找到的,不知道这样有没有问题。

@2betop 2betop closed this as completed in bef936c Jun 3, 2014
@2betop
Copy link
Contributor

2betop commented Jun 3, 2014

可以的,就这么解决吧,多谢!

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

No branches or pull requests

2 participants