-
Notifications
You must be signed in to change notification settings - Fork 987
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
Changing height of SortableItem after drag start breaks size calculations #83
Comments
Hmmm. I haven't given much thought to this scenario, but it is something I'd be willing to support. Not sure what the best approach would be though, because detecting element resize can be tricky. One way I can think of to solve this in a flexible manner would be by passing in a If you don't mind getting your hands dirty, I'd be happy to look at any PR that would attempt to solve this :) |
It is tricky, because we probably want to animate the shrink-effect, so it wouldn't help to detect size after the outer onDragStart. In our specific case we are going from dynamic heights to a fixed height, so it could even be a number prop as configuration. But a configuration function would be great as well. I'm happy to come up with a PR, just thought I would ask you first in case you had already though of it, or had ideas :) |
@clauderic do you suppose that instead of copying the raw dom node to the base of the body tag, could it make a new react component, using the SortableItem, and just passing in different props to indicate that it is in drag mode ? |
…-height Add a getHelperDimensions fn to control SortableItem size. Fixes clauderic#83
We wanted to shrink the dragged element
onSortStart
, but at that time the height of the element is already read and subsequently used for move coordinate calculations. Is there any thing we can hook into in order to set height before it is read, or do we need to start working on an enhancement to react-sortable-hoc?If element 1 is 500px high and we set it to 50px on sort start, it will displace the following elements 450px too far towards the top of the container.
The text was updated successfully, but these errors were encountered: