Sortable
Sortable copied to clipboard
fix: compatible with shadowNode on touch event
Compatible with the shadowDOM when users trigger touch events.
Previously it uses .parentNode to get the parent node, but if it's a shadowNode, it could get a null. So add the .getRootNode().host to get shadowDOM root node when got null.
Here is a repro sandbox: https://stackblitz.com/edit/typescript-tuvyqs?file=mySortable.js You can confirm it by removing the addition code in line 1953.
@owen-m1 wanted to bring awareness of this PR to you (no rush) - curious if you'd be open to this contribution to better support certain web component scenarios. Thanks!