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
popup弹出时会自动scroll(0,0) #1893
Comments
研究发现,dom.js一个代码写错了。大佬好粗心啊 |
你是指 window scroll(0, 0) 还是 popup 里的容器滚动到顶部。上代码吧。 |
是window.scroll(0,0)了,其实我测试了几次,是popup组件dom.addClass(document.body, 'modal-open'),在dom.js执行el.classList.add(token),添加的modal-open这个样式,引起的,我试过添加其他样式,并不影响,可能是样式的position:fixed引起的。 |
demo 重现不了你所说的问题,还是给个可重现的吧。 |
暂时没有比较好的解决方案,容我三思 - - demo采用的是100%布局,所以没有这个问题 可以的话先加上个全局样式,就能避免了
|
下个版本不再自动这样处理,引入插件,变成可配置。仅在 $layout 为 VIEW_BOX 时才执行这个逻辑。 import { ConfigPlugin } from 'vux'
Vue.use(ConfigPlugin, {
$layout: 'VIEW_BOX' // global config for VUX, since v2.6.0
}) |
但是会引起一个问题。
@airyland 我目前采用 document.addEventListener("touchmove",xxx)去暂时代替一下。
给vux-modal-open no-overflow 设置一下。 目前还没遇到啥问题。。。 |
@airyland vux 版本2.3.4 |
@Zenfeder 确认你是 100% 布局再这样设置。 |
@Zenfeder 改成监听 100% 布局的 div,如果你用 view-box 组件,监听 #vux_view_box_body |
vux@2.5.8, vux-loader@1.1.5, webpack@2.3.3, node@4.4
调出popup时,会自动scroll(0,0)
之前用vux@2.5.1并没有出现这种情况,于是对比调试发现,在popup的index.vue里发现一行代码导致这个问题的出现,
watch:show,代码line129
dom.addClass(document.body, 'modal-open')
The text was updated successfully, but these errors were encountered: