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

拖拽开始时,浏览器默认的拖拽预览图标会从浏览器左上角移动到拖拽目标,能不能直接隐藏这个拖拽预览图标 #2681

Open
1 task done
khan97z opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@khan97z
Copy link

khan97z commented Dec 10, 2024

可复现的链接(包含复现链接与示例代码):

https://vxetable.cn/#/component/grid/rowDrag/sort

问题描述与截图:

image
拖拽开始时,浏览器默认的拖拽预览图标会从浏览器左上角移动到拖拽目标,能不能直接隐藏这个拖拽预览图标
可以在拖拽开始事件中添加下面的代码
const transparentImage = new Image() transparentImage.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' // 透明图片 event.dataTransfer.setDragImage(transparentImage, 0, 0)
放到表格提供的拖拽开始事件的时候,第一次不会生效,第二次之后就生效了,所以是慢一步的,所以只能在源码上去修改

期望的结果:

拖拽的时候不会有这个图标出现

操作系统:

macos

浏览器版本:

chrome 131.0.6778.86

vue 版本:

3.4.37

vxe-pc-ui 版本:

4.3.24

vxe-table 版本:

4.9.20

是否使用当前最新版本?

  • 我已确认是使用当前的最新版本并已按要求提供复现链接与示例代码。
@khan97z khan97z added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant