This commit is contained in:
yumoqing 2025-09-28 16:06:20 +08:00
parent fb7ceb2e35
commit 30a3050c4c

View File

@ -519,15 +519,16 @@ bricks.UiFile = class extends bricks.VBox {
this.set_css('hover', true);
var files = [];
for (const f of event.dataTransfer.files) {
if (this.opts.accept && f.type.startsWith(this.opts.accept)){
files.push(f);
if (this.opts.accept && ! f.type.startsWith(this.opts.accept)){
continue;
}
files.push(f);
};
if (this.opts.multiple){
this.value = files;
this.set_input_file(files);
} else {
this.value = file[0];
this.value = files[0];
this.set_input_file([this.value]);
}
this.dispatch('changed', this.value);