Skip to content

Commit

Permalink
fix(upload): verify if accept attribute includes file type
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Feb 18, 2021
1 parent 9232a5d commit 831e922
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {focus} from './focus'
function upload(element, fileOrFiles, init) {
const hasFileWithInvalidType =
!Array.isArray(fileOrFiles) &&
element.accept &&
!element.accept.includes(element.type)
Boolean(element.accept) &&
!element.accept.includes(fileOrFiles.type)

if (hasFileWithInvalidType || element.disabled) return

Expand Down

0 comments on commit 831e922

Please sign in to comment.