wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

点击图片 菜单bar 编辑图片, modal框在4K大屏幕上定位错误, 在小屏mac m1Pro上是正常的

Open OrrinHatch opened this issue 3 years ago • 5 comments

bug 描述

编辑图片modal框定位错误

你预期的样子是?

按照官方demo正常展示

系统和浏览器及版本号

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

wangEditor 版本

最新

demo 能否复现该 bug ?

不能

  • 中文 demo https://www.wangeditor.com/demo/
  • English demo https://www.wangeditor.com/demo/?lang=en

在线 demo

请尽量提供在线 demo (推荐以下网站),帮助我们最低成本复现 bug

  • https://codesandbox.io/
  • https://codepen.io/
  • https://stackblitz.com/

最小成本的复现步骤

(请告诉我们,如何最快的复现该 bug)

OrrinHatch avatar Sep 19 '22 08:09 OrrinHatch

我没有 4K大屏幕 ,你截个图看看吧。

wangfupeng1988 avatar Sep 19 '22 08:09 wangfupeng1988

截屏2022-09-19 17 24 03 m1pro 正常显示

OrrinHatch avatar Sep 19 '22 09:09 OrrinHatch

截屏2022-09-19 17 26 07 4K大屏幕

OrrinHatch avatar Sep 19 '22 09:09 OrrinHatch

截屏2022-09-19 17 27 54 m1Pro left:656px

OrrinHatch avatar Sep 19 '22 09:09 OrrinHatch

// 获取 modal 定位
  private getPosition(): Partial<IPositionStyle> {
    const editor = getEditorInstance(this)
    const positionNode = this.menu.getModalPositionNode(editor)

    if (Element.isElement(positionNode)) {
      // elem node ,按 node 定位
      return getPositionByNode(editor, positionNode, 'modal')
    }

    // 其他情况(如 positionNode == null 或是 text node)则按选区定位
    return getPositionBySelection(editor)
}

这个this.menu.getModalPositionNode(editor) 是去拿去位置吗

OrrinHatch avatar Sep 19 '22 09:09 OrrinHatch