Skip to content

Commit

Permalink
only load drag and drop overlay if drag event contains file (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
interim17 authored Dec 20, 2024
1 parent a0ab8d8 commit cd1df4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/containers/Simularium/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,11 @@ class App extends React.Component<AppProps, AppState> {
public handleDragOverViewer(event: DragEvent) {
const { dragOverViewer, fileIsDraggedOverViewer } = this.props;
event.preventDefault();

const hasFiles = event.dataTransfer?.types.includes("Files");

clearTimeout(this.endDragover);
if (!fileIsDraggedOverViewer) {
if (!fileIsDraggedOverViewer && hasFiles) {
dragOverViewer();
}
}
Expand Down

0 comments on commit cd1df4d

Please sign in to comment.