From 843e6d24cabd9e9e448b98b27bd197686b48c825 Mon Sep 17 00:00:00 2001 From: Ken Snyder Date: Tue, 26 Apr 2022 16:04:11 -0600 Subject: [PATCH] Update getDropZoneProps to pass the event object Currently, any custom handlers for onDragOver and onDrop do not receive the event object. This unobtrusive code change allows developers to access the event object. --- src/Files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.js b/src/Files.js index 5e2a2fd..6cd8178 100644 --- a/src/Files.js +++ b/src/Files.js @@ -234,11 +234,11 @@ class Files extends React.Component { ...rest, onDragOver: e => { e.preventDefault(); - typeof onDragOver === "function" && onDragOver(); + typeof onDragOver === "function" && onDragOver(e); }, onDrop: async e => { e.preventDefault(); - typeof onDrop === "function" && onDrop(); + typeof onDrop === "function" && onDrop(e); this.onDropFilesHandler({ e, onSuccess, onError }); } };