Skip to content

Commit

Permalink
set accept attribute on input element to only accept images
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Letts committed Jan 28, 2023
1 parent 36dd95a commit 2da5d97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions projects/ngx-image-compress/src/lib/image-compress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export class ImageCompress {
inputElement.id = 'upload-input' + new Date();
inputElement.style.display = 'none';
inputElement.setAttribute('type', 'file');
inputElement.setAttribute('accept', 'image/*');

if (multiple) {
inputElement.setAttribute('multiple', 'true');
Expand Down

0 comments on commit 2da5d97

Please sign in to comment.