element-plus [Component] [tree] Tree 树形控件 拖动事件 node-drag-leave 触发位置不正确

vql8enpb  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(65)

Bug Type: Component

Environment

  • Vue Version: 3.2.45
  • Element Plus Version: 2.2.28
  • Browser / OS: UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
  • Build Tool: Vite

Reproduction

  • el-tree

Element Plus Playground

Steps to reproduce

拖动 Level three 2-2-1 到 Level two 2-2 到 Level three 2-1-1 触发了 node-drag-leave 事件,node-drag-leave 事件返回值不正确

What is Expected?

具体看图

What is actually happening?

具体看图

Additional comments

(empty)

acruukt9

acruukt91#

错误的触发顺序
因为拖动并没有离开 Level one 2 但是 node-drag-leave 的 dropNode 返回值 返回了 Level one 2

z9ju0rcb

z9ju0rcb2#

正确的触发顺序

f8rj6qna

f8rj6qna3#

关于改动
修改 oldDropNode 判断 通过 新的DropNode 和 旧的 oldDropNode key对比是否离开当前节点才触发

相关问题