From fdd39ab749bb5f312513ecca08cb20cd9625dc84 Mon Sep 17 00:00:00 2001 From: jame mackson Date: Mon, 8 Nov 2021 19:51:45 -0600 Subject: [PATCH] don't initialize body scroll when in fastboot --- addon/components/mobile-menu/tray.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addon/components/mobile-menu/tray.js b/addon/components/mobile-menu/tray.js index b6e4eccd..7e649e61 100644 --- a/addon/components/mobile-menu/tray.js +++ b/addon/components/mobile-menu/tray.js @@ -1,4 +1,5 @@ import Component from '@glimmer/component'; +import { getOwner } from '@ember/application'; import { htmlSafe } from '@ember/string'; import { action } from '@ember/object'; import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'; @@ -13,6 +14,11 @@ import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'; * @hide */ export default class TrayComponent extends Component { + fastboot = getOwner(this).lookup('service:fastboot'); + get isFastBoot() { + return !!this.fastboot?.isFastBoot; + } + /** * Width of the menu in px. * @@ -83,7 +89,7 @@ export default class TrayComponent extends Component { @action toggleBodyScroll(target, [isClosed]) { - if (this.args.preventScroll && !this.args.embed) { + if (this.args.preventScroll && !this.args.embed && !this.isFastBoot) { if (isClosed) { enableBodyScroll(target); } else {