react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

Wanted: Supports passing in a Ref or HTMLElement as handle

Open zhmushan opened this issue 3 years ago • 3 comments
trafficstars

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.

zhmushan avatar Nov 01 '22 10:11 zhmushan

@STRML I'd love to make a PR for this, if you agree.

zhmushan avatar Nov 01 '22 10:11 zhmushan

Yeah I think that makes sense.

STRML avatar Nov 01 '22 10:11 STRML

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

PuruVJ avatar Dec 06 '22 18:12 PuruVJ