未验证 提交 0c50c7e9 编写于 作者: K kyle 提交者: GitHub

enhancement: don't block scrolling if HighlightCode is not scrollable (#4463)

上级 62ed4db1
......@@ -36,10 +36,11 @@ export default class HighlightCode extends Component {
const scrollOffset = visibleHeight + scrollTop
const isElementScrollable = contentHeight > visibleHeight
const isScrollingPastTop = scrollTop === 0 && deltaY < 0
const isScrollingPastBottom = scrollOffset >= contentHeight && deltaY > 0
if (isScrollingPastTop || isScrollingPastBottom) {
if (isElementScrollable && (isScrollingPastTop || isScrollingPastBottom)) {
e.preventDefault()
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册