fix: fixed width issues of old and new sidebar (#1374)

Co-authored-by: Awais Ansari <79941147+awais-ansari@users.noreply.github.com>
This commit is contained in:
sundasnoreen12
2024-04-30 17:40:23 +05:00
committed by GitHub
parent cf3a91dde0
commit 799e57f970
5 changed files with 51 additions and 24 deletions

View File

@@ -30,7 +30,7 @@ const invisibleStyle = {
* included when determining which children will fit or not. Usage of this ref
* is optional.
*/
export default function useIndexOfLastVisibleChild() {
export default function useIndexOfLastVisibleChild(isSidebarOpen) {
const containerElementRef = useRef(null);
const overflowElementRef = useRef(null);
const containingRectRef = useRef({});
@@ -72,7 +72,7 @@ export default function useIndexOfLastVisibleChild() {
setIndexOfLastVisibleChild(nextIndexOfLastVisibleChild);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [windowSize, containerElementRef.current]);
}, [windowSize, containerElementRef.current, isSidebarOpen]);
return [indexOfLastVisibleChild, containerElementRef, invisibleStyle, overflowElementRef];
}