From d6a25a447e7e5bad8f4d2b80f0bd13527a6141e9 Mon Sep 17 00:00:00 2001 From: reddyashish <43763136+reddyashish@users.noreply.github.com> Date: Thu, 23 May 2024 12:15:39 -0700 Subject: [PATCH] Revert "remove(LibraryItem):forced scroll at componentDidMount (#188)" (#234) This reverts commit f3e06159582a03451978778c3ad683fb24df8f82. --- src/components/LibraryItem.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/LibraryItem.tsx b/src/components/LibraryItem.tsx index 54405eb..110af0a 100644 --- a/src/components/LibraryItem.tsx +++ b/src/components/LibraryItem.tsx @@ -100,6 +100,26 @@ export class LibraryItem extends React.Component { + return item.expanded == true; + }); + if (isThereChildItemsToExpand.length == 0) { + setTimeout(() => { + let elem = ReactDOM.findDOMNode(this); + elem.scrollIntoView(false); + }, 0); + } + + } + } + render() { if ((this.props.libraryContainer.state?.hostingContext == HostingContextType.home) && this.props.data.hiddenInWorkspaceContext){