React-sortable-hoc: Having to drag too far

Created on 20 Aug 2018  Â·  6Comments  Â·  Source: clauderic/react-sortable-hoc

I have a component and trying to drag it requires me to drag too far, video: https://vimeo.com/285899639
source code: https://github.com/conradkay/todo-app-jest-flow-router-react-redux

Most helpful comment

I had the same issue. It was caused by wrong calculation of the edgeOffset, when the SortableElement is nested inside another wrapper element, and so offsetTop is multiplied (see here: https://github.com/clauderic/react-sortable-hoc/blob/master/src/utils.js#L121)
to fix it, I've set position: relative to the wrapper element, so that the offsetTop of the SortableElement will be zero.

All 6 comments

Were you able to solve this? I'm having the same problem.

I have since stopped using react-sortable-hoc, so no :(

On Sat, Sep 8, 2018 at 1:01 AM Tanya Gamarian notifications@github.com
wrote:

Were you able to solve this? I'm having the same problem.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/clauderic/react-sortable-hoc/issues/419#issuecomment-419613256,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXqzzBzKawSGdDzd9BaoGrdFZGXvIfShks5uY08LgaJpZM4WEpot
.

Same problem, do you have solution?

I had the same issue. It was caused by wrong calculation of the edgeOffset, when the SortableElement is nested inside another wrapper element, and so offsetTop is multiplied (see here: https://github.com/clauderic/react-sortable-hoc/blob/master/src/utils.js#L121)
to fix it, I've set position: relative to the wrapper element, so that the offsetTop of the SortableElement will be zero.

@naamagr YEAAAH! It works, you saved me a lot of time, thanks!

I had the same issue. It was caused by wrong calculation of the edgeOffset, when the SortableElement is nested inside another wrapper element, and so offsetTop is multiplied (see here: https://github.com/clauderic/react-sortable-hoc/blob/master/src/utils.js#L121)
to fix it, I've set position: relative to the wrapper element, so that the offsetTop of the SortableElement will be zero.

In my case I just got rid of a wrapper element which helped. Thanks a lot for the tip!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

silvenon picture silvenon  Â·  4Comments

ricokahler picture ricokahler  Â·  3Comments

sami616 picture sami616  Â·  4Comments

botoxparty picture botoxparty  Â·  3Comments

zaygraveyard picture zaygraveyard  Â·  3Comments