diff --git a/demo/Dropzone.tsx b/demo/Dropzone.tsx index a01dfa6..28aa2c9 100644 --- a/demo/Dropzone.tsx +++ b/demo/Dropzone.tsx @@ -67,7 +67,10 @@ export default function Dropzone({ children, onFileDrop, onUrlDrop, onError }: D function onDragOver(e: DragEvent) { e.preventDefault() } - function onDragLeave() { + function onDragLeave(e: DragEvent) { + const items = e.dataTransfer?.items + if (!items) return + if (!Array.from(items).some(item => item.kind === 'file')) return setEnters(enters => enters - 1) } function handleFileDrop(e: DragEvent) { diff --git a/demo/bundle.min.js b/demo/bundle.min.js index 54299f7..f43cfdd 100644 --- a/demo/bundle.min.js +++ b/demo/bundle.min.js @@ -7,5 +7,5 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function _(){if(c)return v;c=1;var e=i(),t=w();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n