From 30a3050c4c43f8a2a45f4b193ea01f0be3c886db Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 28 Sep 2025 16:06:20 +0800 Subject: [PATCH] bugfix --- bricks/input.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bricks/input.js b/bricks/input.js index 971f4ba..b9c8fa2 100644 --- a/bricks/input.js +++ b/bricks/input.js @@ -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);