Skip to content

Commit

Permalink
Try to fix events not rendering sometimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H committed Jan 6, 2025
1 parent b66c2d5 commit 1e8debf
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions newIDE/app/src/EventsSheet/EventsTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,6 @@ export default class ThemableEventsTree extends Component<
const listWrapper = currentList.wrappedInstance.current;
if (listWrapper) {
listWrapper.recomputeRowHeights();
// For some reason the List scroll is reset to 0 twice when the component is mounted.
if (this._isForcedToInitialScroll && !this.props.searchResults) {
listWrapper.scrollToPosition(this.props.initialScrollPosition);
}
}
}
if (cb) cb();
Expand Down Expand Up @@ -1019,6 +1015,22 @@ export default class ThemableEventsTree extends Component<
const treeData = this.state.treeData ? [...this.state.treeData] : null;
const zoomLevel = this.props.fontSize || 14;

if (this._isForcedToInitialScroll) {
if (this.props.searchResults) {
this._isForcedToInitialScroll = false;
}
else {
const currentList = this._list;
if (currentList) {
const listWrapper = currentList.wrappedInstance.current;
if (listWrapper && listWrapper.Grid.state.scrollTop !== this.props.initialScrollPosition) {
// For some reason the List scroll is reset to 0 twice when the component is mounted.
listWrapper.scrollToPosition(this.props.initialScrollPosition);
}
}
}
}

return (
<div
style={{
Expand Down

0 comments on commit 1e8debf

Please sign in to comment.