Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a fullHeight property to the viewConfig and updates the setIFrameHeight method to adjust the host container and pre-render wrapper heights when this mode is active. A critical regression was identified where the standard iframe height assignment was commented out, which would break resizing in default scenarios. Other feedback includes optimizing the code by caching dimension calculations, removing redundant type casting, and cleaning up trailing whitespace.
| if (this.viewConfig.fullHeight && this.isPreRendered) { | ||
| if (this.preRenderWrapper) { | ||
| this.preRenderWrapper.style.height = getCssDimension(height); | ||
| } | ||
| // Also grow the host container (this.el) so in-flow siblings are | ||
| // pushed down correctly and the page layout reflects the real height. | ||
| if (this.el) { | ||
| (this.el as HTMLElement).style.height = getCssDimension(height); | ||
| } | ||
| } | ||
| // this.iFrame.style.height = getCssDimension(height); |
There was a problem hiding this comment.
The implementation of setIFrameHeight contains a regression and several minor issues:
- Regression: The default logic for setting the iframe height (
this.iFrame.style.height) has been commented out. This will prevent the iframe from resizing correctly in all standard (non-prerendered) scenarios or whenfullHeightis disabled. - Efficiency:
getCssDimension(height)is called three times. It should be calculated once and stored in a variable. - Redundancy: The cast
(this.el as HTMLElement)is unnecessary asthis.elis already declared as anHTMLElement. - Style: There is significant trailing whitespace on several lines (e.g., 1125, 1127, 1130).
const cssHeight = getCssDimension(height);
if (this.viewConfig.fullHeight && this.isPreRendered) {
if (this.preRenderWrapper) {
this.preRenderWrapper.style.height = cssHeight;
}
// Also grow the host container (this.el) so in-flow siblings are
// pushed down correctly and the page layout reflects the real height.
if (this.el) {
this.el.style.height = cssHeight;
}
}
this.iFrame.style.height = cssHeight;
commit: |
|
SonarQube Quality Gate
|








No description provided.