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

Commit dacffdd

Browse files
committed
Add some comments
Signed-off-by: Šimon Brandner <[email protected]>
1 parent d547cd5 commit dacffdd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/structures/RoomView.tsx

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

1140+
// We always increment the counter no matter the types, because dragging is
1141+
// still happening. If we didn't, the drag counter would get out of sync.
11401142
this.setState({dragCounter: this.state.dragCounter + 1});
11411143

1144+
// See:
1145+
// https://docs.w3cub.com/dom/datatransfer/types
1146+
// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file
11421147
if (ev.dataTransfer.types.includes("Files") || ev.dataTransfer.types.includes("application/x-moz-file")) {
11431148
this.setState({draggingFile: true});
11441149
}
@@ -1165,6 +1170,9 @@ export default class RoomView extends React.Component<IProps, IState> {
11651170

11661171
ev.dataTransfer.dropEffect = 'none';
11671172

1173+
// See:
1174+
// https://docs.w3cub.com/dom/datatransfer/types
1175+
// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file
11681176
if (ev.dataTransfer.types.includes("Files") || ev.dataTransfer.types.includes("application/x-moz-file")) {
11691177
ev.dataTransfer.dropEffect = 'copy';
11701178
}

0 commit comments

Comments
 (0)