react-draggable
react-draggable copied to clipboard
Wanted: Supports passing in a Ref or HTMLElement as handle
It is easy to increase the mental burden by specifying the handle through the selector. I need to always pay attention that there is no duplicate name in these selectors. In React, Ref is very flexible and convenient. If it can support specifying handle through Ref, it must be very cool.
@STRML I'd love to make a PR for this, if you agree.
Yeah I think that makes sense.
Tooting my own horn here: @neodrag/react supports this already if you want https://github.com/PuruVJ/neodrag/tree/main/packages/react#handle
Docs aren't updated fully yet, but you can pass an array of HTMLElement/ Refs as well. Passing an HTML element or Ref, or mixing and matching inside the array, all of it works