Skip to content

Commit 1e8debf

Browse files
committed
Try to fix events not rendering sometimes.
1 parent b66c2d5 commit 1e8debf

File tree

1 file changed

+16
-4
lines changed
  • newIDE/app/src/EventsSheet/EventsTree

1 file changed

+16
-4
lines changed

newIDE/app/src/EventsSheet/EventsTree/index.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,6 @@ export default class ThemableEventsTree extends Component<
456456
const listWrapper = currentList.wrappedInstance.current;
457457
if (listWrapper) {
458458
listWrapper.recomputeRowHeights();
459-
// For some reason the List scroll is reset to 0 twice when the component is mounted.
460-
if (this._isForcedToInitialScroll && !this.props.searchResults) {
461-
listWrapper.scrollToPosition(this.props.initialScrollPosition);
462-
}
463459
}
464460
}
465461
if (cb) cb();
@@ -1019,6 +1015,22 @@ export default class ThemableEventsTree extends Component<
10191015
const treeData = this.state.treeData ? [...this.state.treeData] : null;
10201016
const zoomLevel = this.props.fontSize || 14;
10211017

1018+
if (this._isForcedToInitialScroll) {
1019+
if (this.props.searchResults) {
1020+
this._isForcedToInitialScroll = false;
1021+
}
1022+
else {
1023+
const currentList = this._list;
1024+
if (currentList) {
1025+
const listWrapper = currentList.wrappedInstance.current;
1026+
if (listWrapper && listWrapper.Grid.state.scrollTop !== this.props.initialScrollPosition) {
1027+
// For some reason the List scroll is reset to 0 twice when the component is mounted.
1028+
listWrapper.scrollToPosition(this.props.initialScrollPosition);
1029+
}
1030+
}
1031+
}
1032+
}
1033+
10221034
return (
10231035
<div
10241036
style={{

0 commit comments

Comments
 (0)