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
先打开一个drawer,再打开drawer中的modal,关闭modal,关闭drawer,再打开另一个modal,关闭后body无法滚动 #23362
Comments
drawer打开时,rc-drawer下的DrawerChild的toggleScrollingToDrawerAndBody方法会将body的overflow设置为“hidden”,在modal1关闭时,switchScrollingEffect中的条件if (openCount === 1 && !Object.keys(cacheOverflow).length)成立,cacheOverflow被赋值。modal2关闭时执行了switchScrollingEffect中else if中的内容。body被设置为"overflow: hidden"。个人见解,可以删掉DrawerChild的toggleScrollingToDrawerAndBody方法,因为看上去已经在rc-drawer的外层做了固定body的处理了 |
Duplicate of #21894 |
not duplicate of #21894 |
为什么关了 还没解决 怎么给关了呢 |
我用4.15.0也遇到了,感觉没修复,然后问题都关了 |
我加了下面样式解决的 |
这样会造成Drawer和Body 滚动条都会出现的呀 |
function removeStyle() {
const styleTags = document.getElementsByTagName('style');
for (let i = 0; i < styleTags.length; i++) {
const rcUtilKey = styleTags[i].getAttribute('rc-util-key');
if (rcUtilKey?.indexOf('rc-util-locker') === 0) {
styleTags[i].remove();
}
}
}
window.addEventListener('popstate', () => {
removeStyle();
});
window.addEventListener('load', () => {
removeStyle();
}); |
您的邮件已收到。----------------------张智慧----------------------
|
Reproduction link
Steps to reproduce
What is expected?
body可正常滚动
What is actually happening?
如上操作后body无法滚动
The text was updated successfully, but these errors were encountered: