@@ -30,6 +30,7 @@ import {t, tct} from 'sentry/locale';
3030import type { Event } from 'sentry/types/event' ;
3131import type { TagCollection } from 'sentry/types/group' ;
3232import { defined } from 'sentry/utils' ;
33+ import { useElementWidth } from 'sentry/utils/useElementWidth' ;
3334import {
3435 TableBodyCell ,
3536 TableHead ,
@@ -220,6 +221,7 @@ export function LogsInfiniteTable({
220221
221222 const tableRef = useRef < HTMLTableElement > ( null ) ;
222223 const tableBodyRef = useRef < HTMLTableSectionElement > ( null ) ;
224+ const tableWidth = useElementWidth ( tableRef ) ;
223225 const [ expandedLogRows , setExpandedLogRows ] = useState < Set < string > > (
224226 new Set ( embeddedOptions ?. openWithExpandedIds ?? [ ] )
225227 ) ;
@@ -556,7 +558,7 @@ export function LogsInfiniteTable({
556558 < FloatingBackToTopContainer
557559 position = { expanded === undefined ? 'fixed' : 'absolute' }
558560 inReplay = { ! ! embeddedOptions ?. replay }
559- tableWidth = { tableRef . current ?. getBoundingClientRect ( ) . width ?? 0 }
561+ tableWidth = { tableWidth }
560562 >
561563 { ! embeddedOptions ?. replay && (
562564 < BackToTopButton
@@ -571,9 +573,7 @@ export function LogsInfiniteTable({
571573 < JumpButtons jump = "up" onClick = { onClickToJump } tableHeaderHeight = { 0 } />
572574 ) : null }
573575 </ FloatingBackToTopContainer >
574- < FloatingBottomContainer
575- tableWidth = { tableRef . current ?. getBoundingClientRect ( ) . width ?? 0 }
576- >
576+ < FloatingBottomContainer tableWidth = { tableWidth } >
577577 { embeddedOptions ?. replay && showJumpDownButton ? (
578578 < JumpButtons jump = "down" onClick = { onClickToJump } tableHeaderHeight = { 0 } />
579579 ) : null }
0 commit comments