Web:Common:Components: fix display navigation for root folder

This commit is contained in:
Timofey 2022-02-21 16:09:21 +08:00
parent f30cb432f7
commit 42c92a436d

View File

@ -40,6 +40,7 @@ const Navigation = ({
const onMissClick = (e) => {
e.preventDefault;
const path = e.path || (e.composedPath && e.composedPath());
if (!firstClick) {
!path.includes(dropBoxRef.current) ? toggleDropBox() : null;
} else {
@ -56,7 +57,7 @@ const Navigation = ({
);
const toggleDropBox = React.useCallback(() => {
if (isRootFolder) return;
if (isRootFolder) return setIsOpen(false);
setIsOpen((prev) => !prev);
setFirstClick(true);
@ -66,7 +67,7 @@ const Navigation = ({
DomHelpers.getOuterWidth(document.getElementById("section"))
);
}, 0);
}, [setIsOpen, setFirstClick, setChangeWidth, isRootFolder]);
}, [isRootFolder]);
React.useEffect(() => {
if (isOpen) {