Skip to content

Commit

Permalink
fix(): #314, bal-file-upload: clear state of html input file on chang…
Browse files Browse the repository at this point in the history
…e to fix the bug, emit change event only if list of files changed - not if rejection happened
  • Loading branch information
nobilo committed Jul 28, 2021
1 parent 56f5909 commit 8529906
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 58 deletions.
10 changes: 0 additions & 10 deletions packages/components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ export class FileUpload {
}
}
}
this.files = [...list]
this.balChangeEventEmitter.emit(this.files)
if(this.files.length !== list.length) {
this.files = [...list]
this.balChangeEventEmitter.emit(this.files)
}
}
}

Expand Down Expand Up @@ -172,9 +174,10 @@ export class FileUpload {
}

onChange = (): void => {
if ((this.fileInput, this.fileInput.files)) {
if (this.fileInput?.files) {
const files = this.fileInput.files
this.handleFiles(files)
this.fileInput.value = ''
}
}

Expand Down
47 changes: 2 additions & 45 deletions packages/testing/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8529906

Please sign in to comment.