Skip to content

Commit aa92e49

Browse files
committed
fix: add delay on extra check when scrolling long list
1 parent d542aa9 commit aa92e49

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/webui/src/client/ui/SegmentTimeline/SegmentTimelineContainer.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,18 @@ const SegmentTimelineContainerContent = withResolvedSegment(
195195
RundownViewEventBus.on(RundownViewEvents.REWIND_SEGMENTS, this.onRewindSegment)
196196
RundownViewEventBus.on(RundownViewEvents.GO_TO_PART, this.onGoToPart)
197197
RundownViewEventBus.on(RundownViewEvents.GO_TO_PART_INSTANCE, this.onGoToPartInstance)
198-
window.requestAnimationFrame(() => {
199-
this.mountedTime = Date.now()
200-
if (this.state.isLiveSegment && this.props.followLiveSegments && !this.isVisible) {
201-
scrollToSegment(this.props.segmentId, true).catch((error) => {
202-
if (!error.toString().match(/another scroll/)) console.warn(error)
203-
})
204-
}
205-
})
198+
// Delay is to ensure UI has settled before checking:
199+
setTimeout(() => {
200+
window.requestAnimationFrame(() => {
201+
this.mountedTime = Date.now()
202+
if (this.state.isLiveSegment && this.props.followLiveSegments && !this.isVisible) {
203+
console.log('SegmentTimelinecontainer is not visible')
204+
scrollToSegment(this.props.segmentId, true).catch((error) => {
205+
if (!error.toString().match(/another scroll/)) console.warn(error)
206+
})
207+
}
208+
})
209+
}, 500)
206210
window.addEventListener('resize', this.onWindowResize)
207211
this.updateMaxTimeScale()
208212
.then(() => this.showEntireSegment())

0 commit comments

Comments
 (0)