Skip to content
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

don't initialize body scroll when in fastboot #187

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion addon/components/mobile-menu/tray.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
}
Comment on lines +17 to +20
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fastboot = getOwner(this).lookup('service:fastboot');
get isFastBoot() {
return !!this.fastboot?.isFastBoot;
}
get fastboot() {
return getOwner(this).lookup('service:fastboot');
}
get isFastBoot() {
return !!this.fastboot?.isFastBoot;
}

To be in line with the updated syntax on master.


/**
* Width of the menu in px.
*
Expand Down Expand Up @@ -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 {
Expand Down