mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-18 07:22:08 +03:00
Merge pull request #5414 from matrix-org/t3chguy/fix/7420
Fix drag drop file to upload for Safari
This commit is contained in:
commit
f0ca8e152e
1 changed files with 3 additions and 10 deletions
|
@ -1115,17 +1115,10 @@ export default class RoomView extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
ev.dataTransfer.dropEffect = 'none';
|
ev.dataTransfer.dropEffect = 'none';
|
||||||
|
|
||||||
const items = [...ev.dataTransfer.items];
|
if (ev.dataTransfer.types.includes("Files") || ev.dataTransfer.types.includes("application/x-moz-file")) {
|
||||||
if (items.length >= 1) {
|
|
||||||
const isDraggingFiles = items.every(function(item) {
|
|
||||||
return item.kind == 'file';
|
|
||||||
});
|
|
||||||
|
|
||||||
if (isDraggingFiles) {
|
|
||||||
this.setState({ draggingFile: true });
|
this.setState({ draggingFile: true });
|
||||||
ev.dataTransfer.dropEffect = 'copy';
|
ev.dataTransfer.dropEffect = 'copy';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private onDrop = ev => {
|
private onDrop = ev => {
|
||||||
|
|
Loading…
Reference in a new issue