lucaspulliese / vue-cool-lightbox

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

Scroll Lock #47

Closed Shade465 closed 4 years ago

Shade465 commented 4 years ago

Hi! Please add scroll lock like a BodyScrollLock.

betz0r commented 4 years ago

You can realize that using the following snippet, this.index is pointing to the index used

watch: {
            scrollDisable: function() {
                if(this.scrollDisable){
                    document.documentElement.style.overflow = 'hidden'
                    return
                }
                document.documentElement.style.overflow = 'auto'
            }
        },

and

computed: {
            scrollDisable: function () {
                return this.index != null
            }
}
Shade465 commented 4 years ago

You can realize that using the following snippet, this.index is pointing to the index used

watch: {
            scrollDisable: function() {
                if(this.scrollDisable){
                    document.documentElement.style.overflow = 'hidden'
                    return
                }
                document.documentElement.style.overflow = 'auto'
            }
        },

and

computed: {
            scrollDisable: function () {
                return this.index != null
            }
}

See what the library does. The best solution is to remove content jumps when the scroll is blocked.

lucaspulliese commented 4 years ago

Yep, I realized that this does not work, I am trying to make this component not dependent on other libraries, but if I do not find a solution I will include BodyScrollLock.

Sorry @Shade465, I was very busy and I was not very aware of the component, I will try to catch up with updates.

lucaspulliese commented 4 years ago

@Shade465 I updated the lightbox to a new version, 2.4.3, wich includes this fix. The only thing is I couldn't test it on iOS devices.

Please tell me if everything works fine.

lucaspulliese commented 4 years ago

Closed since no response, feel free to open the issue again if you want.

Shade465 commented 3 years ago

Thx) All ok, and sorry for the late reply