Skip to content
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

Move with Handle #10

Open
kyleknighted opened this issue Oct 11, 2019 · 6 comments · May be fixed by #9
Open

Move with Handle #10

kyleknighted opened this issue Oct 11, 2019 · 6 comments · May be fixed by #9
Labels
enhancement New feature or request

Comments

@kyleknighted
Copy link
Contributor

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.

@pixelass
Copy link
Owner

pixelass commented Oct 12, 2019

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 pixelass added the enhancement New feature or request label Oct 12, 2019
@pixelass pixelass linked a pull request Oct 12, 2019 that will close this issue
@kyleknighted
Copy link
Contributor Author

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

@pixelass
Copy link
Owner

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

@kyleknighted
Copy link
Contributor Author

@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

@pixelass
Copy link
Owner

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
Copy link
Owner

@kyleknighted

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants