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

高度设置为 string 时,大纲锚点失效 #1218

Closed
de1ck opened this issue Apr 27, 2022 · 3 comments
Closed

高度设置为 string 时,大纲锚点失效 #1218

de1ck opened this issue Apr 27, 2022 · 3 comments
Assignees
Milestone

Comments

@de1ck
Copy link

de1ck commented Apr 27, 2022

编辑模式

  • wysiwyg 所见即所得模式
  • ir 即时渲染模式
  • sv 分屏编辑预览模式

描述问题

如果是解析渲染问题的话请在此处贴入 Markdown 原文

期待的结果

截屏或录像

版本信息

  • 版本:
  • 操作系统:
  • 浏览器:

其他信息

@Vanessa219
Copy link
Owner

这里无法重现,我先关闭了。如果可以重现请跟帖描述详细步骤

QQ20220506-112928-HD.mp4

@de1ck
Copy link
Author

de1ck commented May 6, 2022

后面我抽时间整一个复现链接

在通过 cala(100vh - xpx); 设置容器下,滚动失效
目前通过 hash锚点实现该动能
after() {
Vditor.outlineRender(previewElement!, outlineElement!);
if (outlineElement?.innerText.trim() !== '') {
outlineElement!.style.display = 'block';
outlineElement?.addEventListener('click', (event) => {
let target = event.target as HTMLElement | null;
while (target) {
const id = target.getAttribute('data-target-id');
console.log(target, id);
if (target.classList.contains('vditor-outline__action')) {
break;
} else if (id) {
window.location.hash = id;
break;
}
target = target.parentElement;
}
}, {
capture: true,
// passive: true,
});
}
},

@Vanessa219 Vanessa219 changed the title 大纲预览锚点失效 高度设置为 string 时,大纲锚点失效 May 6, 2022
@Vanessa219 Vanessa219 self-assigned this May 6, 2022
@Vanessa219 Vanessa219 added this to the 3.8 milestone May 6, 2022
@Vanessa219 Vanessa219 reopened this May 6, 2022
@Vanessa219
Copy link
Owner

下个版本设置为 calc(100vh - 20px) 再看看

Vanessa219 added a commit that referenced this issue May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants