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

关于 scrollIntoView #115

Open
yubaoquan opened this issue Jul 12, 2024 · 1 comment
Open

关于 scrollIntoView #115

yubaoquan opened this issue Jul 12, 2024 · 1 comment

Comments

@yubaoquan
Copy link
Owner

scrollIntoView 会使当前元素的所有祖先元素滚动, 直到当前元素出现在可视区域

但是如果某个祖先元素A的高度等于视口高度时, 也发生了滚动, 即一个 100vh 的元素的scrollTop发生了变化, 那么可能是元素A中的某些子元素内容区域超出了A的范围导致A被撑起的高度超出了 100vh

@yubaoquan
Copy link
Owner Author

可以把有问题的组件的 overflow 改成 scroll 看一下是否能滚动, 如果能滚动, 说明内容区域比这个组件大了

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

No branches or pull requests

1 participant