drag and drop, better demo images

This commit is contained in:
NilsUeter
2023-06-07 23:54:27 +02:00
parent 34bf449184
commit 0c3326c50d
3 changed files with 16 additions and 0 deletions
+16
View File
@@ -106,6 +106,11 @@ function App() {
} }
}, [roster]); }, [roster]);
const handleDrag = (e) => {
e.preventDefault();
e.stopPropagation();
};
return ( return (
<div <div
className="App" className="App"
@@ -141,6 +146,17 @@ function App() {
htmlFor="rosterUpload" htmlFor="rosterUpload"
className={"rosterUpload " + (roster ? "rosterUploaded" : "")} className={"rosterUpload " + (roster ? "rosterUploaded" : "")}
id="rosterUploadContainer" id="rosterUploadContainer"
onDrop={(e) => {
e.preventDefault();
e.stopPropagation();
if (e.dataTransfer.files && e.dataTransfer.files[0]) {
e.target.files = e.dataTransfer.files;
handleFileSelect(e);
}
}}
onDragEnter={handleDrag}
onDragLeave={handleDrag}
onDragOver={handleDrag}
> >
<div id="preloadContainer"> <div id="preloadContainer">
<span>Upload roster file (.ros, .rosz)</span> <span>Upload roster file (.ros, .rosz)</span>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 286 KiB