lucaspulliese / vue-cool-lightbox

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

Compensate for scrollbar #56

Closed vedmant closed 3 years ago

vedmant commented 4 years ago

Original fancybox compensates scrollbar jump https://prnt.sc/ue57cw

lucaspulliese commented 3 years ago

Yep, I did something like that before but in some browsers it didn't work, so I think I should add something like bodyScrollLock.

But thanks for the suggestion!

lucaspulliese commented 3 years ago

Hi @vedmant! I added bodyScrollLock in version 2.6.0, tell me if it work fine for you.

vedmant commented 3 years ago

@lucaspulliese Thanks!

vedmant commented 3 years ago

@lucaspulliese Just checked, not exactly what I mean, it's compensate-for-scrollbar class, that compensates window just when body scroll is locked, it adds right padding to body (when there is a scrollbar). Here is some old package about this https://github.com/srph/scrollbar-compensate

lucaspulliese commented 3 years ago

Ahh sorry, my bad, I will check that package, thanks.

lucaspulliese commented 3 years ago

Hi @vedmant, you can update the component to version 2.6.1, I added the same as Fancybox do, let me know if it works fine for you.

markhayok commented 3 years ago

Hi, @lucaspulliese! First of all – great work! I have a problem when I try to close the "lightbox" on the mobile device:

TypeError: document.getElementById(...) is null (removeCompensateForScrollbar vue-cool-lightbox.esm.js:484)

"nuxt": "^2.14.6", "vue-cool-lightbox": "^2.6.1"

lucaspulliese commented 3 years ago

Hi @markhayok! Thank you so much!

Update the component to version 2.6.2, It will fix it.

Let me know if that works for you.

markhayok commented 3 years ago

@lucaspulliese Thank you very much! Work well now!