diff --git a/src/canvas/model/Frame.ts b/src/canvas/model/Frame.ts index 69c67b617..06d250832 100644 --- a/src/canvas/model/Frame.ts +++ b/src/canvas/model/Frame.ts @@ -239,6 +239,16 @@ export default class Frame extends ModuleModel { this.em.trigger('frame:updated', { frame: this, ...data }); } + hasAutoHeight() { + const { height } = this.attributes; + + if (height === 'auto' || this.config.infiniteCanvas) { + return true; + } + + return false; + } + toJSON(opts: any = {}) { const obj = ModuleModel.prototype.toJSON.call(this, opts); const defaults = result(this, 'defaults'); diff --git a/src/canvas/view/FrameView.ts b/src/canvas/view/FrameView.ts index fc9c30751..6c9331933 100644 --- a/src/canvas/view/FrameView.ts +++ b/src/canvas/view/FrameView.ts @@ -363,6 +363,7 @@ export default class FrameView extends ModuleView { const doc = this.getDoc(); const body = this.getBody(); const win = this.getWindow(); + const hasAutoHeight = model.hasAutoHeight(); const conf = em.config; //@ts-ignore This could be used inside component-related scripts to check if the // script is executed inside the editor. @@ -376,8 +377,10 @@ export default class FrameView extends ModuleView { `