fix: Fix a bug when the same file is added on the single file input, the model value gets empty
This commit is contained in:
parent
58d56b2b88
commit
d75976a238
1 changed files with 4 additions and 4 deletions
|
|
@ -499,13 +499,13 @@ export class LionInputFile extends ScopedElementsMixin(LocalizeMixin(LionField))
|
|||
|
||||
this._inputNode.files = ev.dataTransfer.files;
|
||||
|
||||
if (this.multiple) {
|
||||
const computedFiles = this.__computeNewAddedFiles(
|
||||
/** @type {InputFile[]} */ (Array.from(ev.dataTransfer.files)),
|
||||
);
|
||||
if (this.multiple) {
|
||||
this.modelValue = [...(this.modelValue ?? []), ...computedFiles];
|
||||
} else {
|
||||
this.modelValue = computedFiles;
|
||||
this.modelValue = Array.from(ev.dataTransfer.files);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
|
|
|
|||
Loading…
Reference in a new issue