Skip to content

Commit

Permalink
Fix Bug 53418 - Client.Files.Drag’n’drop. Fixed dragging file by file…
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
gopienkonikita committed Nov 24, 2021
1 parent 838e734 commit 4155dfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/src/HOCs/withFileActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function withFileActions(WrappedFileItem) {
}
e.preventDefault();
setTooltipPosition(e.pageX, e.pageY);
!isFileName && setStartDrag(true);
setStartDrag(true);
!isActive && setBufferSelection(null);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import TableView from "./TableView/TableContainer";
import { Consumer } from "@appserver/components/utils/context";

let currentDroppable = null;
let isDragActive = false;

const SectionBodyContent = (props) => {
const {
Expand Down Expand Up @@ -80,6 +81,7 @@ const SectionBodyContent = (props) => {
return false;
}

isDragActive = true;
if (!dragging) {
document.body.classList.add("drag-cursor");
setDragging(true);
Expand Down Expand Up @@ -135,9 +137,10 @@ const SectionBodyContent = (props) => {
const elem = e.target.closest(".droppable");
const title = elem && elem.dataset.title;
const value = elem && elem.getAttribute("value");
if ((!value && !treeValue) || isRecycleBinFolder) {
if ((!value && !treeValue) || isRecycleBinFolder || !isDragActive) {
setDragging(false);
setStartDrag(false);
isDragActive = false;
return;
}

Expand All @@ -146,6 +149,7 @@ const SectionBodyContent = (props) => {
setStartDrag(false);
setDragging(false);
onMoveTo(folderId, title);
isDragActive = false;
return;
};

Expand Down Expand Up @@ -228,8 +232,6 @@ export default inject(
fileActionId: fileActionStore.id,
isEmptyFilesList,
setDragging,
startDrag,
setStartDrag,
folderId: selectedFolderStore.id,
setTooltipPosition,
isRecycleBinFolder: treeFoldersStore.isRecycleBinFolder,
Expand Down

0 comments on commit 4155dfd

Please sign in to comment.