Skip to content
New issue

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

Tree树形控件拖拽效果抖动 #4858

Closed
alanwei0 opened this issue Feb 14, 2017 · 13 comments · Fixed by #4867
Closed

Tree树形控件拖拽效果抖动 #4858

alanwei0 opened this issue Feb 14, 2017 · 13 comments · Fixed by #4867

Comments

@alanwei0
Copy link

官网上的拖动示例,在拖拽过程中,UI会出现轻微抖动的情况,体验不是很好

@yesmeck
Copy link
Member

yesmeck commented Feb 14, 2017

浏览器版本?

@alanwei0
Copy link
Author

mac 10.12
chrome 56

我看了一下效果,是因为在拖拽文件夹的时候,在target文件的上面或者下面会出现蓝色的提示线,这个会改变整个容器的高度,所以会一抖一抖的

@yesmeck
Copy link
Member

yesmeck commented Feb 14, 2017

这是正常的反馈。

@yesmeck yesmeck closed this as completed Feb 14, 2017
@alanwei0
Copy link
Author

提示线是正常的反馈,但是整个容器上下抖动也是正常反馈吗

@yesmeck
Copy link
Member

yesmeck commented Feb 14, 2017

@afc163

transition: all 0.3s ease;

@afc163
Copy link
Member

afc163 commented Feb 14, 2017

transition 导致了抖动么?

@RaoHai
Copy link
Contributor

RaoHai commented Feb 14, 2017

&.drag-over-gap-top {

应该是此处添加了一个 border-top 导致。

@RaoHai
Copy link
Contributor

RaoHai commented Feb 14, 2017

默认上下 border 都加个 transparent 的 2px border 就不闪了。

@afc163
Copy link
Member

afc163 commented Feb 14, 2017

会不会影响整体高度?

或者这个 border-top: 2px @primary-color solid; 改成不占空间的 box-shadow ?

@RaoHai
Copy link
Contributor

RaoHai commented Feb 14, 2017

我 PR 一个。

@RaoHai RaoHai reopened this Feb 14, 2017
RaoHai added a commit to RaoHai/ant-design that referenced this issue Feb 14, 2017
@RaoHai
Copy link
Contributor

RaoHai commented Feb 14, 2017

不过这样改了之后有可能比之前难拖一些。因为其实 2px 的 border 相当于变相增加了接受拖放到两个元素之间的区域的高度。

@benjycui
Copy link
Contributor

默认上下 border 都加个 transparent 的 2px border 就不闪了。

其实我还是觉得这个方案比较好,同时把

的上下 padding 减小就好。

主要是觉得 box-shadow 的写法略费解。

image

benjycui pushed a commit that referenced this issue Feb 16, 2017
*  Tree DragOver Gap fix

 + close #4858

* rewrite
@lock
Copy link

lock bot commented May 2, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants