fix: 修复大文档锚点跳转预览滚动位置不正确问题

This commit is contained in:
purocean
2021-10-29 13:56:22 +08:00
parent 31d9846035
commit e6d47c730a
+1
View File
@@ -55,6 +55,7 @@ const handleLink = (link: HTMLAnchorElement) => {
document.getElementById(encodeURIComponent(hash.replace(/^h-/, '')))
if (el) {
await sleep(0)
el.scrollIntoView()
// 如果是标题的话,也顺便将编辑器滚动到可视区域