wangEditor
wangEditor copied to clipboard
点击图片 菜单bar 编辑图片, modal框在4K大屏幕上定位错误, 在小屏mac m1Pro上是正常的
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)
我没有 4K大屏幕 ,你截个图看看吧。
m1pro 正常显示
4K大屏幕
m1Pro left:656px
// 获取 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) 是去拿去位置吗