Skip to content

Commit

Permalink
Fix dragging file into panel
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Noah committed Apr 19, 2021
1 parent d52b639 commit a8cf7c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/editor/panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ for(const panel of document.querySelectorAll<HTMLElement>(".panel")){
}, false);

panel.addEventListener("drop", (e: DragEvent) => {
if(e.dataTransfer?.files){
return;
}

e.stopPropagation();
e.preventDefault();

panel.style.borderColor = "";

const id = e.dataTransfer?.getData("text/plain");
Expand Down

0 comments on commit a8cf7c9

Please sign in to comment.