Fix Tree View Misbehavior

Summary: The misbehavior came from undefined height and width inside `Sidebar` component. This is fixed by put it in the container that expands through whole `Sidebar`.

Reviewed By: Andrey-Mishanin

Differential Revision: D23954008

fbshipit-source-id: 9c096a8f3141a012a2a1ab32c2d5e689e7bde396
This commit is contained in:
Chaiwat Ekkaewnumchai
2020-09-28 02:01:42 -07:00
committed by Facebook GitHub Bot
parent ecf4cff7cf
commit 95ae7a8bce
4 changed files with 62 additions and 48 deletions

View File

@@ -62,6 +62,12 @@ const InfoBox = styled.div({
textAlign: 'center',
});
const TreeContainer = styled.div({
width: '100%',
height: '100%',
overflow: 'hidden',
});
type Events = {
addEvent: AddEventPayload;
updateTreeGenerationHierarchyGeneration: UpdateTreeGenerationHierarchyGenerationPayload;
@@ -264,14 +270,16 @@ export function Component() {
}}
/>
</Sidebar>
<Layout.Top>
<Layout.Top scrollable={false}>
<Sidebar position="top" minHeight={400} height={400}>
<TreeHierarchy
generation={focusedTreeGeneration}
focusedChangeSet={focusedChangeSet}
setSelectedTreeNode={setSelectedTreeNode}
selectedNodeIndexPath={focusInfo?.treeNodeIndexPath}
/>
<TreeContainer>
<TreeHierarchy
generation={focusedTreeGeneration}
focusedChangeSet={focusedChangeSet}
setSelectedTreeNode={setSelectedTreeNode}
selectedNodeIndexPath={focusInfo?.treeNodeIndexPath}
/>
</TreeContainer>
</Sidebar>
{focusedTreeGeneration && (
<StackTrace