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

fix: 修复 Table 的 columns-toggler 中列拖拽排序逻辑错误 #11616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BeMxself
Copy link
Contributor

What

  • 拖拽列的时候把交换列修复为移动列,与拖动时的视觉指示相匹配
  • 简化并修复 dragEnd 事件处理逻辑,删除直接修改 DOM 的代码(因为无效)
  • 删除 swapColumnPosition 方法
  • 增加 moveColumn 方法
  • 增加拖拽列时的文字提示

Why

在 columns-toggler 中启用 draggable 后,拖拽列的时候,视觉指示的效果是把拖拽的列移动到目标位置,而实际上是与目标位置的列交换,存在严重矛盾,应视为BUG。

How

  • 删除交换列方法,替换为移动列

- 简化并修复 dragEnd 事件处理逻辑,删除直接修改 DOM 的代码(因为无效)
- 把交换列修复为移动列,与拖动时的视觉指示相匹配
- 删除 swapColumnPosition 方法
- 增加 moveColumn 方法
@github-actions github-actions bot added the bug Something isn't working label Feb 16, 2025
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@BeMxself BeMxself changed the title refactor(Table): 优化列拖拽排序逻辑 fix: 修复 Table 的 columns-toggler 中列拖拽排序逻辑错误 Feb 16, 2025
@BeMxself
Copy link
Contributor Author

相关问题:#11186

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

Successfully merging this pull request may close these issues.

2 participants