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

当页面发生滚动后,dnd中的节点拖拽到画布中会延迟一会儿才显示 #4461

Closed
wuweinero opened this issue Oct 7, 2024 · 13 comments

Comments

@wuweinero
Copy link

问题描述

当页面发生滚动后(不是画布滚动,是整个网页页面上下滚动),dnd中的节点立即拖拽到画布中会延迟一会儿才显示。
补充1:如果滚动之后,过两三秒再拖拽节点,则没有延迟。
补充2:如果滚动后,立即拖拽到页面中,然后迅速手动再滚动一次页面,则会立即渲染该节点。

重现链接

https://x6.antv.antgroup.com/tutorial/plugins/dnd

重现步骤

1.进入上述官方示例网页
2.用鼠标滑轮滚动页面后,迅速拖拽一个节点到画布中,就可以看到延迟的现象
3.滚动后静置2-3s,再拖拽节点到画布中,则没有延迟
注意,每次滚动后,只有首次拖拽会出现这个现象。

预期行为

我期望页面滚动后,立即拖拽节点到画布中时,不要延迟长达2s左右,而是控制在1s以内

平台

  • 操作系统: Windows
  • 网页浏览器: Google Chrome
  • X6 版本: 2.18.1

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Oct 7, 2024

👋 @wuweinero

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@zlecheng
Copy link

楼主解决了吗

@EasonYeang
Copy link

EasonYeang commented Oct 23, 2024

这个问题是否有解决办法?应该不是dnd的问题,因为我是自定义的拖拽面板也复现了问题。

@xielinhan
Copy link

我也遇到这个问题了,当鼠标滚轮滚动后,针对元素的修改方法会延迟生效。但是拖动滚动条没问题

@zlecheng
Copy link

zlecheng commented Nov 4, 2024 via email

@xielinhan
Copy link

@zlecheng 难顶,我就算把滚动条隐藏了,只要用了鼠标滚动就能复现

@zlecheng
Copy link

zlecheng commented Nov 4, 2024 via email

@wuweinero
Copy link
Author

换成1.x版本可以解决

@zlecheng
Copy link

zlecheng commented Nov 4, 2024

换成1.x版本可以解决

那这也不现实啊

@wuweinero
Copy link
Author

换成1.x版本可以解决

那这也不现实啊

这个库似乎已经不再维护了,使用1.x和2.x区别不大,都存在一些历史遗留问题,我只是随手试了一下1.x发现能用,就没再在2.x上测试解决方案了😂

@xielinhan
Copy link

xielinhan commented Nov 4, 2024 via email

@NyuuuuOrz
Copy link

换成1.x版本可以解决

那这也不现实啊

似乎是异步渲染导致的。
初始化画布时async属性设置为false试试呢?这个属性在2.x版本中被默认置为true了。

@EasonYeang
Copy link

换成1.x版本可以解决

那这也不现实啊

似乎是异步渲染导致的。 初始化画布时async属性设置为false试试呢?这个属性在2.x版本中被默认置为true了。

async:false似乎可以解决这个问题(未充分测试),但是会引发其它问题,比如自定义vue节点拖拽渲染时,在mounted中获取node.attr()中绑定的自定义数据为undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@EasonYeang @NyuuuuOrz @wuweinero @zlecheng @xielinhan and others