-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #6998: add closest check condition to detect handle icon drag. #7051
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
32e8840
to
e67641d
Compare
Fantastic debugging! Can you try this one to see if it can be simplified logic... const isDragHandle = isUnstyled()
? DomHandler.getAttribute(event.target, 'data-pc-section') === 'rowreordericon' || event.target.closest('[data-pc-section="rowreordericon"]')
: DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle') || event.target.closest('.p-datatable-reorderablerow-handle');
event.currentTarget.draggable = isDragHandle;
event.target.draggable = !isDragHandle; |
thank you for suggestion :) i modified it |
Defect Fixes
Cause
<path>
) of the icon.In the video, you can see in the console that sorting fails to work when
event.target
is a<path>
element.2024-08-15.1.52.29.mp4
Solution
closest
(mdn docs) function is employed to check if the parent element ofevent.target
is the handle element.<path>
) within the icon is selected, as long as the parent element is the handle.fixed example
222.mp4