Skip to content

Commit

Permalink
Do nothing when there are no files
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Dec 29, 2024
1 parent 34e1806 commit 5263b92
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/javascript/controllers/upload_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default class extends Controller {
}

async handleDrop(e) {
if (!e.dataTransfer.files.length) return

this.dropAreaTarget.classList.add("hidden")
this.loaderTarget.classList.remove("hidden")

Expand Down

0 comments on commit 5263b92

Please sign in to comment.