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

Move with Handle

Open kyleknighted opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? Please describe. Instead of the entire Box being draggable, it would be nice if we could associate a moveHandle or something to a specific component so that the rest of the box does not steal away pointer-events.

kyleknighted avatar Oct 11 '19 17:10 kyleknighted

This is available in v2.

It will look something like this

const MyDraggable = ({initialPosition, children}) => {
    const [{x, y}, {
        onMouseDown,
        onTouchStart,
        ...positionProps
    }] = usePosition(initialPosition, {});
    return (
        <div style={{transform: `translate3d(${x}px, ${y}px, 0)`}}>
            <div
                className="drag-handle"
                onMouseDown={onMouseDown}
                onTouchStart={onTouchStart}/>
            <div className="content">{children}</div>
        </div>
}

pixelass avatar Oct 12 '19 01:10 pixelass

@pixelass Do you know when you'd expect to release v2?

kyleknighted avatar Oct 16 '19 18:10 kyleknighted

I'm targeting the end of this month. Things are looking good. There are minor things that need to be changed/added back in.

pixelass avatar Oct 16 '19 21:10 pixelass

@pixelass I'm not trying to rush, only assist. Would it be useful for you to have me begin implementing v2 to see if I run into any issues/bugs/lacking documentation... etc? If it would only interfere with your progress, then no worries, just didn't want to begin any migration to the next version if you felt like the API may change

kyleknighted avatar Oct 28 '19 12:10 kyleknighted

The API will remain almost unchanged. I am currently struggling with minor features (e.g. aspect-ratio resizing) I also need to refactor the new snapping logic (currently working on that)

I will try to finish the snapping and then release a beta before I add aspect-ratio.I should be able to finish it within the next one or two days. I hope that helps.

Besides that I'm happy for any help offered. I am especially missing documentation and tests which should both be present before a stable v2 will be released. Feel free to open new issues to discuss this further.

pixelass avatar Oct 28 '19 14:10 pixelass

@kyleknighted

https://www.npmjs.com/package/react-mops/v/2.0.0-beta.0

pixelass avatar Oct 30 '19 15:10 pixelass