TraceView: Fix broken rendering when scrolling in Dashboard panel in Firefox (#56642)

This commit is contained in:
zdg-github
2022-11-24 11:49:55 +01:00
committed by GitHub
parent 276b54fe9d
commit a2f1d2e102
@@ -215,10 +215,20 @@ export default class ListView extends React.Component<TListViewProps> {
}
}
componentDidUpdate() {
componentDidUpdate(prevProps: TListViewProps) {
if (this._itemHolderElm) {
this._scanItemHeights();
}
// When windowScroller is set to false, we can continue to handle scrollElement
if (this.props.windowScroller) {
return;
}
// check if the scrollElement changes and update its scroll listener
if (prevProps.scrollElement !== this.props.scrollElement) {
prevProps.scrollElement?.removeEventListener('scroll', this._onScroll);
this._wrapperElm = this.props.scrollElement;
this._wrapperElm?.addEventListener('scroll', this._onScroll);
}
}
componentWillUnmount() {