We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
之前的issue: #3873 以及相关修改: #3953
当 draggingContainer 没有设置 position 时(即默认的position:static),这里错误的减掉了draggingContainer的偏移; 另外,当 draggingContainer 或其它上层容器有滚动条时,也没有正确计算进去
draggingContainer
position
position:static
无
No response
看了下 ant-design-vue,使用的是 dom-align 库进行对齐计算的,它会处理各层容器的scroll、position等
附上使用dom-align修复方案作参考
dom-align
export default class MyDndPlugin extends Dnd { protected updateGraphPosition(clientX: number, clientY: number) { const delta = this.delta!; const nodeBBox = this.geometryBBox; const padding = this.padding || 5; const offset = { left: clientX - delta.x - nodeBBox.width / 2 - padding, top: clientY - delta.y - nodeBBox.height / 2 - padding, }; if (this.draggingGraph) { alignPoint( this.container, { clientX: offset.left, clientY: offset.top, }, { points: ['tl'], }, ); } // TODO 原组件目前没有使用这个返回值(代码注释掉了) // 而 dom-align 又没有返回计算后的top/left值 // 考虑干掉? return offset; } }
The text was updated successfully, but these errors were encountered:
fix: use dom-align to position dnd container (antvis#3978)
e23d877
fix: use dom-align to position dnd container (#3978) (#3979)
2d3b365
* fix: use `dom-align` to position dnd container (#3978) * fix: Remove unused `originOffset` in plugin-dnd --------- Co-authored-by: cluezhang <[email protected]>
This thread has been automatically locked because it has not had recent activity.
Please open a new issue for related bugs and link to relevant comments in this thread.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
之前的issue: #3873 以及相关修改: #3953
当
draggingContainer
没有设置position
时(即默认的position:static
),这里错误的减掉了draggingContainer
的偏移;另外,当
draggingContainer
或其它上层容器有滚动条时,也没有正确计算进去Your Example Website or App
无
Steps to Reproduce the Bug or Issue
无
Expected behavior
无
Screenshots or Videos
No response
Platform
Additional context
看了下 ant-design-vue,使用的是 dom-align 库进行对齐计算的,它会处理各层容器的scroll、position等
附上使用
dom-align
修复方案作参考The text was updated successfully, but these errors were encountered: