Skip to content
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中嵌套popup或有动态渲染的popup时 lock-scroll失效 #3134

Closed
Azraelj opened this issue Jul 9, 2024 · 1 comment · Fixed by #3150
Closed

popup中嵌套popup或有动态渲染的popup时 lock-scroll失效 #3134

Azraelj opened this issue Jul 9, 2024 · 1 comment · Fixed by #3150

Comments

@Azraelj
Copy link
Contributor

Azraelj commented Jul 9, 2024

NutUI 包名

@nutui/nutui

NutUI 版本号

4.3.6

平台

h5

重现链接

https://nutui.jd.com/playground/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8ZGl2IDpzdHlsZT1cIntoZWlnaHQ6ICcxMTB2aCd9XCI+XG4gICAgPG51dC1jZWxsIHRpdGxlPVwiQ2VudGVyXCIgaXMtbGluayBAY2xpY2suc3RvcD1cInNob3cgPSB0cnVlXCI+PC9udXQtY2VsbD5cbiAgICA8bnV0LXBvcHVwIHYtbW9kZWw6dmlzaWJsZT1cInNob3dcIiA6c3R5bGU9XCJ7IHBhZGRpbmc6ICczMHB4IDUwcHgnIH1cIiBAY2xvc2U9XCJzaG93ID0gZmFsc2VcIj4gXG4gICAgICA8bnV0LWJ1dHRvbiBAY2xpY2s9XCJpbm5lclNob3cgPSB0cnVlXCI+5rWL6K+VPC9udXQtYnV0dG9uPlxuICAgICAgPG51dC1wb3B1cCB2LW1vZGVsOnZpc2libGU9aW5uZXJTaG93IEBjbG9zZT1cImlubmVyU2hvdyA9IGZhbHNlXCI+XG4gICAgICBcdDxudXQtYnV0dG9uIEBjbGljaz1cImlubmVyU2hvdyA9IGZhbHNlXCI+aW5uZXI8L251dC1idXR0b24+XG4gICAgICA8L251dC1wb3B1cD5cbiAgICA8L251dC1wb3B1cD5cbiAgPC9kaXY+XG4gIFxuPC90ZW1wbGF0ZT5cbjxzY3JpcHQgc2V0dXA+XG5pbXBvcnQgeyByZWYgfSBmcm9tICd2dWUnXG5jb25zdCBzaG93ID0gcmVmKGZhbHNlKVxuY29uc3QgaW5uZXJTaG93ID0gcmVmKGZhbHNlKVxuPC9zY3JpcHQ+XG4ifQ==

重现步骤

1、依次打开外部popup和内部popup,此时lock-scroll正常工作
2、关闭两个popup
3、再次打开外部popup,此时lock-scroll失效

期望的结果是什么?

再次打开外部popup时lock-scroll仍然有效

实际的结果是什么?

再次打开外部popup时lock-scroll失效

环境信息

System:
OS: macOS 13.6.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 1.18 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
pnpm: 9.0.5 - ~/.nvm/versions/node/v14.19.0/bin/pnpm
Browsers:
Chrome: 126.0.6478.127
Safari: 17.3.1
npmPackages:
@nutui/nutui: ^4.3.6 => 4.3.6

其他补充信息

目前lock-scroll的锁定和解锁使用了watchEffect,当destroy-on-close为true或者内部有条件渲染的其他popup时会导致外层popup弹出时的锁定操作被内层popup初始化时触发的解锁操作解锁。是否可以改为使用watch替代watchEffect。另外lock-scroll是否需要考虑keep-alive场景下的跳转解锁,比如在keep-alive的页面中popup内部有路由跳转动作,此时不会触发解锁,跳转后的页面无法滚动。

@Azraelj
Copy link
Contributor Author

Azraelj commented Jul 10, 2024

另外请问有什么办法能获取到popup组件的dom引用?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant