Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d547cd5

Browse files
committed
Show drop file UI only if dragging a file
Signed-off-by: Šimon Brandner <[email protected]>
1 parent cd39474 commit d547cd5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/structures/RoomView.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,10 +1137,11 @@ export default class RoomView extends React.Component<IProps, IState> {
11371137
ev.stopPropagation();
11381138
ev.preventDefault();
11391139

1140-
this.setState({
1141-
dragCounter: this.state.dragCounter + 1,
1142-
draggingFile: true,
1143-
});
1140+
this.setState({dragCounter: this.state.dragCounter + 1});
1141+
1142+
if (ev.dataTransfer.types.includes("Files") || ev.dataTransfer.types.includes("application/x-moz-file")) {
1143+
this.setState({draggingFile: true});
1144+
}
11441145
};
11451146

11461147
private onDragLeave = ev => {

0 commit comments

Comments
 (0)