[v9.3.x] TraceView: Fix broken rendering when scrolling in Dashboard panel in Firefox (#59281)

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

(cherry picked from commit a2f1d2e102)

Co-authored-by: zdg-github <52441803+zdg-github@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-11-24 14:31:56 +01:00
committed by GitHub
co-authored by zdg-github
parent 556bec41c9
commit c0ddd089ef
@@ -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() {