Skip to content

tree drag , 拖拽式使用border 对样式有些影响, 建议使用 after before 等伪元素 #2440

@pengfeiWang

Description

@pengfeiWang
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.6.1

Environment

mac os

Reproduction link

https://jshare.com.cn/temp/FtG0Xa

Steps to reproduce

动态切换 draggable, 有抖动现象

What is expected?

border 换成伪元素

What is actually happening?

动态切换 draggable, 树抖动


简单写了下样式, 应该是可以解决border导致抖动问题

.ant-tree li span[draggable],
.ant-tree li span[draggable='true'] {
  line-height: 24px !important;
  border: 0;
  position: relative;
}


.ant-tree li span[draggable]:after{
  content: ' ';
  position: absolute;
  background: @primary-color;
  height: 2px;
  top: 0;
  left: 0;
  right: 0;
  display: none;
}
.ant-tree li.drag-over-gap-top > span[draggable]:after{
  display: block;
}
.ant-tree li.drag-over-gap-bottom > span[draggable]:after {
  top: auto;
  bottom: 0;
  display: block;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions