Skip to content

Commit

Permalink
refactor: use correct window reference
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed May 22, 2024
1 parent 903dd32 commit dc47512
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/machines/file-upload/src/file-upload.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export function machine(userContext: UserDefinedContext) {
const inputEl = dom.getHiddenInputEl(ctx)
if (!inputEl) return

const dataTransfer = new DataTransfer()
const win = dom.getWin(ctx)
const dataTransfer = new win.DataTransfer()

ctx.acceptedFiles.forEach((v) => {
dataTransfer.items.add(v)
})
Expand Down

0 comments on commit dc47512

Please sign in to comment.