Merge pull request #1198 from ONLYOFFICE/bugfix/fixed-selection-area-drag

Web: Files: fixed dragging, added hiding selection-area after losing …
This commit is contained in:
Ilya Oleshko 2023-02-10 15:41:58 +03:00 committed by GitHub
commit cba56a1be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,6 +234,9 @@ class SelectionArea extends React.Component {
passive: false,
});
document.addEventListener("mouseup", this.onTapStop);
window.addEventListener("blur", this.onTapStop);
this.scrollElement.addEventListener("scroll", this.onScroll);
};
@ -242,6 +245,7 @@ class SelectionArea extends React.Component {
document.removeEventListener("mousemove", this.onTapMove);
document.removeEventListener("mouseup", this.onTapStop);
window.removeEventListener("blur", this.onTapStop);
this.scrollElement.removeEventListener("scroll", this.onScroll);
};
@ -256,7 +260,11 @@ class SelectionArea extends React.Component {
folderHeaderHeight,
} = this.props;
if (e.target.closest(".not-selectable")) return;
if (
e.target.closest(".not-selectable") ||
e.target.closest(".row-selected")
)
return;
const selectables = document.getElementsByClassName(selectableClass);
if (!selectables.length) return;