Skip to content

Commit

Permalink
Merge pull request #316 from baloise/bugfix/bal-file-upload-fix
Browse files Browse the repository at this point in the history
fix(): #314, bal-file-upload: clear state of html input file on chang…
  • Loading branch information
nobilo authored Jul 28, 2021
2 parents 56f5909 + 8529906 commit 426d647
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.

2 comments on commit 426d647

@vercel
Copy link

@vercel vercel bot commented on 426d647 Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 426d647 Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.