Skip to content

Commit

Permalink
fix(frontend): fix scroll behavior in test specs list (#3320)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Nov 1, 2023
1 parent 96ff847 commit 4629c9a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
6 changes: 4 additions & 2 deletions web/src/components/RunDetailTest/RunDetailTest.styled.ts
Expand Up @@ -16,10 +16,11 @@ export const SectionLeft = styled(Section)`
z-index: 1;
`;

export const SectionRight = styled(Section)<{$shouldScroll: boolean}>`
export const SectionRight = styled(Section)`
background-color: ${({theme}) => theme.color.white};
box-shadow: 0 20px 24px rgba(153, 155, 168, 0.18);
overflow-y: ${({$shouldScroll}) => ($shouldScroll ? 'scroll' : 'hidden')};
overflow: hidden;
position: relative;
z-index: 2;
`;

Expand All @@ -32,6 +33,7 @@ export const SwitchContainer = styled.div`

export const TabsContainer = styled.div`
height: 100%;
overflow-y: auto;
padding: 24px;
position: relative;
Expand Down
24 changes: 12 additions & 12 deletions web/src/components/RunDetailTest/TestPanel.tsx
Expand Up @@ -123,7 +123,7 @@ const TestPanel = ({run, testId, runEvents}: IProps) => {
/>
</S.SectionLeft>

<S.SectionRight $shouldScroll={!selectedTestSpec}>
<S.SectionRight>
{isTestSpecFormOpen && (
<TestSpecForm
onSubmit={values => {
Expand Down Expand Up @@ -202,19 +202,19 @@ const TestPanel = ({run, testId, runEvents}: IProps) => {
<TestOutputs outputs={outputs} />
</Tabs.TabPane>
</Tabs>

<TestSpecDetail
isOpen={Boolean(selectedTestSpec)}
onClose={handleClose}
onDelete={handleDelete}
onEdit={handleEdit}
onRevert={handleRevert}
onSelectSpan={handleSelectSpan}
selectedSpan={selectedSpan?.id}
testSpec={selectedTestSpec}
/>
</S.TabsContainer>
)}

<TestSpecDetail
isOpen={Boolean(selectedTestSpec)}
onClose={handleClose}
onDelete={handleDelete}
onEdit={handleEdit}
onRevert={handleRevert}
onSelectSpan={handleSelectSpan}
selectedSpan={selectedSpan?.id}
testSpec={selectedTestSpec}
/>
</S.SectionRight>
</S.Container>
</FillPanel>
Expand Down

0 comments on commit 4629c9a

Please sign in to comment.