lucaspulliese / vue-cool-lightbox

Vue.js lightbox inspired by fancybox.
https://vue-cool-lightbox.lucaspulliese.com
341 stars 54 forks source link

Body scroll error #63

Closed zachu90 closed 3 years ago

zachu90 commented 3 years ago

Hi, This package is awesome. Thank you for creating it. I only have one issue with it. It keeps throwing error in the console:

bodyScrollLock.esm.js?e181:192 enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.

I am using chrome on windows 10.

Any ideas on how to fix this?

lucaspulliese commented 3 years ago

Hi @zachu90!

Thanks for your words! :D

What version are you using? Because I fixed that before. Another question, if you go to the docs, does it throw you the error as well?

zachu90 commented 3 years ago

@lucaspulliese I am using "vue-cool-lightbox": "^2.6.7"

If I go to the docs the error isn't there.

I am using the package with Nuxt SPA mode. The errors are thrown when I navigate from one page to another.

The stacktrace shows that the method is invoked by vue-cool-lightbox:

  beforeDestroy: function beforeDestroy () {
    if (this.enableScrollLock) {
      this.removeCompensateForScrollbar();
      enableBodyScroll(this.$refs.coolLightbox);
    }
  },
winfieldblum commented 3 years ago

Great package Lucas. I really like it!

I'm am also getting the same thing. Using "vue-cool-lightbox": "^2.6.7", like zuchu90 For my case, the error triggers when I navigate away from the page with VCL. You can see what happens for me here: MyReflections-JSError

My implementation of VCL is pretty basic;

`

` I also using Chrome on W10

Hope that helps you get to the bottom of it :) Thanks!

lucaspulliese commented 3 years ago

Hi @changefox! Thanks! I'm glad that you like it.

Thanks to both for the info! I will take a look at it today 👍

lucaspulliese commented 3 years ago

Hello guys!

Sorry for taking so long to solve it, I've had a lot of work this week. Please update the component to 2.6.8 version and let me know if everything work fine for you.

zachu90 commented 3 years ago

@lucaspulliese Thanks a lot! Version 2.6.8 fixes the issue for me,

winfieldblum commented 3 years ago

Yeah good for me too! :)