Skip to content

Commit c4f1f4c

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

File tree

1 file changed

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

1 file changed

+17
-4
lines changed

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

Lines changed: 17 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={{
@@ -1070,6 +1082,7 @@ export default class ThemableEventsTree extends Component<
10701082
className={
10711083
this.props.searchResults ? eventsTreeWithSearchResults : ''
10721084
}
1085+
//scrollTop={this.props.initialScrollPosition}
10731086
reactVirtualizedListProps={{
10741087
ref: list => (this._list = list),
10751088
onScroll: event => {

0 commit comments

Comments
 (0)