Skip to content

Commit 34e1349

Browse files
committed
fix: use css optimization instead of VirtualElement
1 parent 3ff013d commit 34e1349

File tree

2 files changed

+2
-197
lines changed

2 files changed

+2
-197
lines changed

packages/webui/src/client/lib/VirtualElement.tsx

Lines changed: 0 additions & 182 deletions
This file was deleted.

packages/webui/src/client/ui/RundownView.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import {
5252
RundownLayoutRundownHeader,
5353
RundownLayoutFilterBase,
5454
} from '@sofie-automation/meteor-lib/dist/collections/RundownLayouts'
55-
import { VirtualElement } from '../lib/VirtualElement.js'
5655
import { SEGMENT_TIMELINE_ELEMENT_ID } from './SegmentTimeline/SegmentTimeline.js'
5756
import { OffsetPosition } from '../utils/positions.js'
5857
import { MeteorCall } from '../lib/meteorApi.js'
@@ -933,7 +932,6 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
933932
return null
934933
}
935934

936-
let globalIndex = 0
937935
const rundowns = this.props.matchedSegments.map((m) => m.rundown._id)
938936

939937
return this.props.matchedSegments.map((rundownAndSegments, rundownIndex, rundownArray) => {
@@ -977,18 +975,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
977975

978976
return (
979977
<ErrorBoundary key={unprotectString(segment._id)}>
980-
<VirtualElement
981-
className={ClassNames({
982-
'segment-timeline-wrapper--hidden': segment.isHidden,
983-
'segment-timeline-wrapper--shelf': segment.showShelf,
984-
})}
985-
id={SEGMENT_TIMELINE_ELEMENT_ID + segment._id}
986-
margin={'100% 0px 100% 0px'}
987-
initialShow={globalIndex++ < window.innerHeight / 260}
988-
placeholderHeight={260}
989-
placeholderClassName="placeholder-shimmer-element segment-timeline-placeholder"
990-
width="auto"
991-
>
978+
<div style={{ contentVisibility: 'auto', containIntrinsicSize: '0 500px' }}>
992979
{this.renderSegmentComponent(
993980
segment,
994981
segmentIndex,
@@ -1003,7 +990,7 @@ const RundownViewContent = translateWithTracker<IPropsWithReady & ITrackedProps,
1003990
rundownAndSegments.segmentIdsBeforeEachSegment[segmentIndex],
1004991
rundownIdsBefore
1005992
)}
1006-
</VirtualElement>
993+
</div>
1007994
</ErrorBoundary>
1008995
)
1009996
}

0 commit comments

Comments
 (0)