Web: Files: Dialog body offset on scroll fixed.

This commit is contained in:
Tatiana Lopaeva 2022-05-11 15:14:50 +03:00
parent 5e3158b906
commit 1dd162c5df
3 changed files with 15 additions and 4 deletions

View File

@ -239,7 +239,11 @@ class TreeFolders extends React.Component {
if (selectedNode) {
this.needToScroll = false;
selectedNode.scrollIntoView();
selectedNode.scrollIntoView({
block: "nearest",
inline: "nearest",
});
}
}

View File

@ -20,9 +20,15 @@ const FolderTreeBody = ({
const { t } = useTranslation(["SelectFolder", "Common"]);
useEffect(() => {
document
.getElementsByClassName("rc-tree-node-selected")[0]
?.scrollIntoView();
const selectedNode = document.getElementsByClassName(
"rc-tree-node-selected"
)[0];
if (selectedNode) {
selectedNode.scrollIntoView({
block: "nearest",
inline: "nearest",
});
}
}, []);
return (

View File

@ -235,6 +235,7 @@ const StyledTree = styled.div`
.files-tree-menu {
margin-bottom: 22px;
margin-top: 12px !important;
}
.selection-panel_tree-folder {
height: 100%;