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

When I using Tree comp, TreeNode style will still be changed even I set e.preventDefault() in OnDragStart (使用Tree组件时,在OnDragStart中设置并不能阻止TreeNode样式被改变) #36140

Closed
DPGZl opened this issue Jun 21, 2022 · 0 comments

Comments

@DPGZl
Copy link

DPGZl commented Jun 21, 2022

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. set draggable = true
  2. set e.preventDefault() in onDragStart
  3. drag

What is expected?

do not set highlight style for TreeNode when there is a e.preventDefault() in onDragStart.

What is actually happening?

the dragged TreeNode will be set highlight even there is a e.preventDefault() in onDragStart.
image

Environment Info
antd 4.21.3
React 16.13.1
System windows 10
Browser Chrome 102.0.5005.115

In my case, I don't want to set the draggable prop to forbid dragging.
here is my suggestion, maybe need to put L149-L151 after L152? please refer to: https://github.com/react-component/tree/blob/master/src/TreeNode.tsx#L149

@DPGZl DPGZl closed this as completed Jul 27, 2022
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

1 participant