Skip to content

Commit adad4c4

Browse files
authored
fix(ourlogs): Do not double nest buttons (#92330)
1 parent 0c7970e commit adad4c4

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

static/app/components/events/ourlogs/ourlogsSection.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function OurlogsSectionContent({
6868
const logsSearch = useLogsSearch();
6969
const abbreviatedTableData = (tableData.data ?? []).slice(0, 5);
7070
const {openDrawer} = useDrawer();
71-
const logsTableRef = useRef<HTMLButtonElement>(null);
71+
const viewAllButtonRef = useRef<HTMLButtonElement>(null);
7272
const sharedHoverTimeoutRef = useRef<NodeJS.Timeout | null>(null);
7373

7474
const limitToTraceId = event.contexts?.trace?.trace_id;
@@ -97,11 +97,8 @@ function OurlogsSectionContent({
9797
drawerKey: 'logs-issue-drawer',
9898

9999
shouldCloseOnInteractOutside: element => {
100-
const viewAllButton = logsTableRef.current;
101-
if (viewAllButton?.contains(element)) {
102-
return false;
103-
}
104-
return true;
100+
const viewAllButton = viewAllButtonRef.current;
101+
return !viewAllButton?.contains(element);
105102
},
106103
}
107104
);
@@ -128,7 +125,7 @@ function OurlogsSectionContent({
128125
title={t('Logs')}
129126
data-test-id="logs-data-section"
130127
>
131-
<SmallTableContentWrapper ref={logsTableRef} onClick={() => onOpenLogsDrawer()}>
128+
<SmallTableContentWrapper onClick={() => onOpenLogsDrawer()}>
132129
<SmallTable>
133130
<TableBody>
134131
{abbreviatedTableData?.map((row, index) => (
@@ -149,6 +146,7 @@ function OurlogsSectionContent({
149146
aria-label={t('View more')}
150147
size="sm"
151148
onClick={() => onOpenLogsDrawer()}
149+
ref={viewAllButtonRef}
152150
>
153151
{t('View more')}
154152
</Button>
@@ -164,8 +162,7 @@ const SmallTable = styled('table')`
164162
grid-template-columns: 15px auto 1fr;
165163
`;
166164

167-
const SmallTableContentWrapper = styled('button')`
168-
all: unset;
165+
const SmallTableContentWrapper = styled('div')`
169166
display: flex;
170167
flex-direction: column;
171168
`;

0 commit comments

Comments
 (0)