Skip to content

Commit

Permalink
fix: prevent update of scroll position when component is hidden (#2322)
Browse files Browse the repository at this point in the history
Vertical scroll position is updated every time the component is resized,
when the component is hidden its size becomes zero which triggers an
update of the scroll position - however in this case the position
updates to 0,0 due to all sizes equal to 0 while hidden. This causes the
scroll position to be "forgotten" and reset to 0 upon show and then hide
of the component.
The problem could be clearly visible in story
"welllogviewer-demo-classificationlayout--rtc-tabs-layout" where the
component is positioned in a tab container. When switching to a tab2 to
see the component and then to tab3 or tab1 and then back to tab2 the
scroll position is reset.
  • Loading branch information
mirisb authored Oct 17, 2024
1 parent 74d5855 commit c9a2e25
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,11 @@ class WellLogView
if (this.logController)
posWellPickTitles(this.logController, this);

this.onContentRescale();
if (
entry.contentRect.width > 0 &&
entry.contentRect.height > 0
)
this.onContentRescale();
}
}
);
Expand Down

0 comments on commit c9a2e25

Please sign in to comment.