Web:Common:Components: fix display navigation for root folder
This commit is contained in:
parent
f30cb432f7
commit
42c92a436d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user