Show drop file UI only if dragging a file

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-04-06 07:52:02 +02:00
parent cd39474d26
commit d547cd5db8
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 5 additions and 4 deletions

View File

@ -1137,10 +1137,11 @@ export default class RoomView extends React.Component<IProps, IState> {
ev.stopPropagation();
ev.preventDefault();
this.setState({
dragCounter: this.state.dragCounter + 1,
draggingFile: true,
});
this.setState({dragCounter: this.state.dragCounter + 1});
if (ev.dataTransfer.types.includes("Files") || ev.dataTransfer.types.includes("application/x-moz-file")) {
this.setState({draggingFile: true});
}
};
private onDragLeave = ev => {