-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only renderBody when view is visible/expanded #165187
Conversation
fixes PaneView calls renderBody even when the pane is collapsed #164662
@@ -158,6 +159,11 @@ export abstract class Pane extends Disposable implements IView { | |||
this.updateHeader(); | |||
|
|||
if (expanded) { | |||
if (!this._bodyRendered) { | |||
this.renderBody(this.body); | |||
this._bodyRendered = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbatten We should set this to true inside renderBody
, not outside. Especially because renderBody
is protected
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you suggesting to move it out into ViewPane
instead? renderBody
is abstract in the Pane
. Even if a subclass calls this, setting it to true inside renderBody
won't prevent the subclass from calling it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm suggesting making it concrete and have every subclass call super.renderBody()
in their renderBody
implementation first thing.
Revert "only renderBody when view is visible/expanded (#165187)"
fixes PaneView calls renderBody even when the pane is collapsed #164662
cc @joaomoreno