2.13.0
chrome 78.0.3904.108
2.6.10
https://codepen.io/zzxcncz/pen/LYYwOXo
click the image ,then the page can't scroll
click the image ,then the page can scroll
click the image ,then the page can scroll.
i fock the code from the element ui website.The demo of the component in the website can also lead the result. Just click the image ,and chage to other page.Then the other page can't scroll.
i found the reason is when i click the image in a scrolling div. it will add a css in
if i don't need preview the image, the click handler will also add a body style overflow = 'hidden'.
this will lead to i can't scroll the page.
the el-image's click handler code.
clickHandler() {
// prevent body scroll
prevOverflow = document.body.style.overflow;
document.body.style.overflow = 'hidden';
this.showViewer = true;
},
i think add the following code will handle it
clickHandler () {
if (this.previewSrcList.length > 0) {
// prevent body scroll
prevOverflow = document.body.style.overflow
document.body.style.overflow = 'hidden'
this.showViewer = true
}
},
I get this problem too. it seems to make image-viewer run. but haven't check for i had not set preview-src-list.
看起来是为了打开 image-viewer 给body添加了overflow = 'hidden'。但是没有判断是否传了preview-src-list。没有的时候就是把滚动去掉了。这个问题还是挺影响使用的。望尽快修复。
Also encountered this problem.
same problem
Same problem
@luckyCao @island205 Please correct this regression. As soon as _any_ image is clicked, we now permanently and irreversibly get a body { overflow: hidden } attribute added breaking page scrolling.... reproduction link from @zzxCNCZ https://codepen.io/zzxcncz/pen/LYYwOXo
This PR resolves this bug.....
https://github.com/ElemeFE/element/pull/18416
fixed
Most helpful comment
i think add the following code will handle it