Open raunofreiberg opened 4 years ago
I can collapse the draggable item by doing:
height: isDragged || props.style.visibility === 'hidden' ? "50px" : "100px",
But this still requires me to drag over the initial height of it:
@tajo any ideas here?
Utilizing beforeDrag
could get you closer: https://codesandbox.io/s/romantic-cookies-7odri?file=/src/App.js
However, onChange
is not called when the item position is not changed so the height doesn't reset. Maybe we could add afterDrag
or having some better API for this use-case (explicit draggedHeight
prop?). Although, it seems too rare of a use-case to just add a new API for this, so maybe more general afterDrag
to fix my workaround would be the best.
afterDrag
would work for me! With some direction, I could open a PR, if you'd like?
@raunofreiberg Yea, go for it.
Hey,
Thanks for the great library! I have a use case that doesn't seem to be possible.
On drag, I would like to collapse the item along with it's hidden clone. This is quite useful for long lists where items can be pretty large in height. Collapsing them helps navigate through this list.
I tried doing something like:
on the component in
renderItem
but only the ghost item seems to change height, but not the hidden one?Here's an example: https://codesandbox.io/s/sad-einstein-u7feh?file=/src/App.js:1160-1212
Thanks!