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

[Bug Report]浏览器尺寸改变图片控制层出现位置偏移 #1068

Open
shi2310 opened this issue Mar 6, 2025 · 1 comment · May be fixed by #1072
Open

[Bug Report]浏览器尺寸改变图片控制层出现位置偏移 #1068

shi2310 opened this issue Mar 6, 2025 · 1 comment · May be fixed by #1072
Labels
🐞bug Something isn't working

Comments

@shi2310
Copy link

shi2310 commented Mar 6, 2025

预览区选中图片后,会出现”图片控制层“class=cherry-previewer-img-size-handler。此时如果改变浏览器或者容器尺寸,”图片控制层“出现位置偏移
Image

@shi2310 shi2310 added pending-no-confirmed The direction of this issue has not yet been determined. 🐞bug Something isn't working labels Mar 6, 2025
@sunsonliu sunsonliu removed the pending-no-confirmed The direction of this issue has not yet been determined. label Mar 6, 2025
@shi2310 shi2310 changed the title [Bug Report] [Bug Report]浏览器尺寸改变图片控制层出现位置偏移 Mar 6, 2025
@shi2310
Copy link
Author

shi2310 commented Mar 6, 2025

使用js监听,尺寸变化后移除”图片控制层“临时解决,但是不够友好

 const resizeObserver = new ResizeObserver(() => {
    const elements = document.getElementsByClassName(
      "cherry-previewer-img-size-handler"
    );
    elements[0].remove();
});
resizeObserver.observe(document.getElementById("markdown-container"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants